New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
type
regression if textarea has no value before typing
#346
Comments
I'm following this issue as we encountered the same. if we expected to get the following input: "Entering a note." |
Thanks for the report you two. I'll get this fixed soon. Doing a bunch of work on user-event right now. |
Did some further testing, the problem lies in 'jest-environment-jsdom-sixteen' in my own project i was running 'jest-environment-jsdom-global' and apparently the codesandbox online runner ignores the --env in the package scripts |
I don't think it's related, but the newly typed value doesn't show in the rendered markup. Shouldn't it? test(" empty textarea", async () => {
const { debug } = render(<textarea data-testid="textbox" defaultValue="" />);
debug(); // "" in textarea
await userEvent.type(screen.getByTestId("textbox"), "1234");
expect(screen.getByRole("textbox")).toHaveValue("2341"); // the other bug
debug(); // still shows "" instead of "2341"
}); |
I don't know. I'd have to look into it. You can if you like 😁 |
Yeah type is busted for me as well. Not modifying the input at all. |
🎉 This issue has been resolved in version 12.0.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
The codesandbox repro case above is still failing for me for versions 12.0.4/5/6 |
The problem here is that before typing |
If anyone still has this issue, I think I've tracked it down in #391 (comment), and you can subscribe to #391 for updates |
I'm using the latest version of |
@dave-cabbage The reproduction example of this issue works as expected with up-to-date dependencies: Are you by chance using an old version of If your problem does not resolve by updating the dependencies on your project, please file a new issue with a reproduction example like above. :) |
Yes @ph-fritsche, I'm using jsdom 15 with |
@testing-library/user-event
version:jest@26.0.1
@testing-library/jest-dom@5.9.0
@testing-library/react@10.2.1
Relevant code or config
What you did:
Updated from 11.2.1 to 11.4.2
What happened:
library code types incorrectly if the textarea has no value when it start typing
Reproduction repository:
https://codesandbox.io/s/user-event-type-to-add-text-issue-exgpf?file=/src/__tests__/App.test.js
Problem description:
It seems like the "type" event returns to the beginning of the line after it has typed the first letter, after that it returns to normal resulting in the first letter always being at the end of the word/sentence
The text was updated successfully, but these errors were encountered: