Skip to content

Commit c5dc66d

Browse files
committed
fix(MessageComposer): make textarea full-width in custom composer layouts
Scope the .str-chat__textarea sizing rules to the TextareaComposer's own elements instead of the .str-chat__message-composer-controls wrapper, so a custom composer that renders <TextareaComposer> without the default MessageComposerUI still gets a full-width textarea rather than the bare <textarea> falling back to its intrinsic cols width (~160px).
1 parent 3bb8a2f commit c5dc66d

1 file changed

Lines changed: 26 additions & 21 deletions

File tree

src/components/MessageComposer/styling/MessageComposer.scss

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -191,27 +191,6 @@
191191
ease-out;
192192
}
193193

194-
.str-chat__textarea {
195-
flex: 1;
196-
min-width: 0;
197-
position: relative;
198-
display: flex;
199-
align-items: center;
200-
width: 100%;
201-
202-
textarea {
203-
background: transparent;
204-
color: var(--str-chat__input-text-default);
205-
font: var(--str-chat__font-body-default);
206-
resize: none;
207-
border: none;
208-
box-shadow: none;
209-
outline: none;
210-
width: 100%;
211-
scrollbar-width: none;
212-
}
213-
}
214-
215194
.str-chat__emoji-picker-button {
216195
display: flex;
217196
cursor: pointer;
@@ -265,6 +244,32 @@
265244
}
266245
}
267246

247+
// Scoped to the TextareaComposer's own elements (not the composer-controls
248+
// wrapper) so the textarea fills its container in any composer layout — e.g.
249+
// a custom composer that renders <TextareaComposer> without the default
250+
// MessageComposerUI. Without this the bare <textarea> falls back to its
251+
// intrinsic `cols` width (~160px).
252+
.str-chat__textarea {
253+
flex: 1;
254+
min-width: 0;
255+
position: relative;
256+
display: flex;
257+
align-items: center;
258+
width: 100%;
259+
260+
textarea {
261+
background: transparent;
262+
color: var(--str-chat__input-text-default);
263+
font: var(--str-chat__font-body-default);
264+
resize: none;
265+
border: none;
266+
box-shadow: none;
267+
outline: none;
268+
width: 100%;
269+
scrollbar-width: none;
270+
}
271+
}
272+
268273
.str-chat__message-composer--command-active
269274
.str-chat__message-composer__additional-actions {
270275
max-width: 0;

0 commit comments

Comments
 (0)