fix(composer): keep editor active while sending

This commit is contained in:
777genius 2026-05-05 14:35:09 +03:00
parent 85debd95a9
commit acb7854ae7
2 changed files with 10 additions and 1 deletions

View file

@ -247,6 +247,14 @@ function getSendButton(host: HTMLElement): HTMLButtonElement {
return button;
}
function getTextarea(host: HTMLElement): HTMLTextAreaElement {
const textarea = host.querySelector('textarea[aria-label="Message"]');
if (!(textarea instanceof HTMLTextAreaElement)) {
throw new Error('Message textarea not found');
}
return textarea;
}
describe('MessageComposer pending send lifecycle', () => {
beforeEach(() => {
vi.stubGlobal('IS_REACT_ACT_ENVIRONMENT', true);
@ -285,6 +293,8 @@ describe('MessageComposer pending send lifecycle', () => {
})
);
expect(draftHarness.state.text).toBe('');
expect(getTextarea(host).disabled).toBe(false);
expect(getSendButton(host).disabled).toBe(true);
render({ sending: false });

View file

@ -971,7 +971,6 @@ export const MessageComposer = ({
minRows={isCompactLayout ? 1 : 2}
maxRows={6}
maxLength={MAX_TEXT_LENGTH}
disabled={sending}
hintText={crossTeamHintText}
showHint={!isCompactLayout}
cornerActionInset={isCompactLayout ? 'compact' : 'default'}