Skip to content
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

userEvent.paste is case-sensitive #1179

Open
DiFuks opened this issue Nov 24, 2023 · 1 comment · May be fixed by #1180
Open

userEvent.paste is case-sensitive #1179

DiFuks opened this issue Nov 24, 2023 · 1 comment · May be fixed by #1180
Labels
bug Something isn't working needs assessment This needs to be looked at by a team member

Comments

@DiFuks
Copy link

DiFuks commented Nov 24, 2023

Reproduction example

https://codesandbox.io/s/pensive-morning-5fttk8?file=/src/App.js

Prerequisites

  1. Render element
  2. add on paste listener with event.clipboardData?.getData('Text')
  3. call userEvent.paste('hello')

Expected behavior

event.clipboardData?.getData('Text') returned hello

Actual behavior

event.clipboardData?.getData('Text') returned undefined

User-event version

14.5.1

Environment

No response

Additional context

I noticed an issue with userEvent.paste in the following case.

Nevertheless, in the browser, such code works. After examining the Chromium source code, I confirmed this. Chrome intentionally converts the data type name to lowercase. It seems more appropriate to implement similar logic on the userEvent side.

@DiFuks DiFuks added bug Something isn't working needs assessment This needs to be looked at by a team member labels Nov 24, 2023
@DiFuks DiFuks linked a pull request Nov 24, 2023 that will close this issue
3 tasks
@DiFuks
Copy link
Author

DiFuks commented Nov 24, 2023

I submitted a pull request that addresses this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs assessment This needs to be looked at by a team member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant