Skip to content

userEvent.paste is case-sensitive #1179

Description

@DiFuks

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions