Allow image pasting in plain mode in RTE (#11056)

* get rough funcitonality working

* try to tidy up types

* fix merge error

* fix signature change error

* type wrangling

* use onBeforeInput listener

* add onBeforeInput handler, add logic to onPaste

* fix type error

* bring plain text listeners in line with useInputEventProcessor

* extract common function to util file, move tests

* tidy comment

* tidy comments

* fix typo

* add util tests

* add text paste test
This commit is contained in:
alunturner 2023-06-12 12:28:00 +01:00 committed by GitHub
parent 47ab99f908
commit e32823e5fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 188 additions and 104 deletions

View file

@ -290,4 +290,16 @@ describe("PlainTextComposer", () => {
expect(screen.getByTestId("autocomplete-wrapper")).toBeInTheDocument();
});
it("Should allow pasting of text values", async () => {
customRender();
const textBox = screen.getByRole("textbox");
await userEvent.click(textBox);
await userEvent.type(textBox, "hello");
await userEvent.paste(" world");
expect(textBox).toHaveTextContent("hello world");
});
});