You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add on paste listener with event.clipboardData?.getData('Text')
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.
The text was updated successfully, but these errors were encountered:
Reproduction example
https://codesandbox.io/s/pensive-morning-5fttk8?file=/src/App.js
Prerequisites
on paste
listener withevent.clipboardData?.getData('Text')
userEvent.paste('hello')
Expected behavior
event.clipboardData?.getData('Text')
returnedhello
Actual behavior
event.clipboardData?.getData('Text')
returned undefinedUser-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.
The text was updated successfully, but these errors were encountered: