Skip to content

userEvent.paste possibly casts string to a number #1053

Closed

Description

@jnous-5

Reproduction example

https://codesandbox.io/s/happy-architecture-1crzb7?file=/src/App.test.js

Prerequisites

  1. Go to Tests tab and run the test
  2. Notice that the test fails due to mismatched paste value
  3. If you check console log of App, the raw e.target.value equals to 0.8 (instead of .80)

Expected behavior

userEvent.paste should return .80.

Actual behavior

userEvent.paste returns 0.8 (was somehow cast to a number?).

User-event version

14.4.3

Environment

N/A. Can be reproduced in codesandbox.

Additional context

This used to work in v13+. Please see repro below.
https://codesandbox.io/s/hungry-wildflower-e5o25n?file=/src/App.test.js

Activity

  1. added
    bugSomething isn't working
    needs assessmentThis needs to be looked at by a team member
    on Sep 6, 2022
  2. added and removed
    needs assessmentThis needs to be looked at by a team member
    on Sep 14, 2022
  3. github-actions commented on Nov 10, 2026

    @github-actions

    🎉 This issue has been resolved in version 14.6.9 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  4. added a commit that references this issue on Nov 12, 2026
    edef34d
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions