Make keyboard handling in and out of autocomplete completions consistent (#11344)
* Make keyboard handling in and out of autocomplete completions consistent * Add test
This commit is contained in:
parent
b2eac5b65c
commit
340e301844
2 changed files with 12 additions and 2 deletions
|
@ -82,6 +82,18 @@ describe("BasicMessageComposer", () => {
|
|||
expect(transformedText).toBe(after + " ");
|
||||
}
|
||||
});
|
||||
|
||||
it("should not mangle shift-enter when the autocomplete is open", async () => {
|
||||
const model = new EditorModel([], pc, renderer);
|
||||
render(<BasicMessageComposer model={model} room={room} />);
|
||||
|
||||
const input = screen.getByRole("textbox");
|
||||
|
||||
await userEvent.type(input, "/plain foobar");
|
||||
await userEvent.type(input, "{Shift>}{Enter}{/Shift}");
|
||||
const transformedText = model.parts.map((part) => part.text).join("");
|
||||
expect(transformedText).toBe("/plain foobar\n");
|
||||
});
|
||||
});
|
||||
|
||||
function generateMockDataTransferForString(string: string): DataTransfer {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue