fix(composer): keep editor active while sending
This commit is contained in:
parent
85debd95a9
commit
acb7854ae7
2 changed files with 10 additions and 1 deletions
|
|
@ -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 });
|
||||
|
||||
|
|
|
|||
|
|
@ -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'}
|
||||
|
|
|
|||
Loading…
Reference in a new issue