Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

userEvent.type not typing into Material UI DatePicker if it has focus #1276

Open
ldadarabl opened this issue Feb 21, 2025 · 0 comments
Open
Labels
bug Something isn't working needs assessment This needs to be looked at by a team member

Comments

@ldadarabl
Copy link

Reproduction example

https://codesandbox.io/p/sandbox/userevent-type-material-ui-datepicker-bug-px38kj

Prerequisites

  1. Be on laptop/desktop such that the desktop variant of the DatePicker Component will be rendered. (Typing is not allowed in the mobile variant).
  2. Have dependencies installed as specified in the provided codesandbox
  3. Have a react component that renders the Material UI DatePicker Component
  4. Have a test that uses userEvent.type to type into the DatePicker Component

Expected behavior

When the DatePicker component has focus before userEvent.type is called, then typing should occur and the field value should change accordingly.

Actual behavior

When the DatePicker component has focus before userEvent.type is called, then typing seems not to occur because the value of the field does not change.

User-event version

14.1.1

Environment

See package.json of codesandbox

Additional context

Example tests are provided in App.test.jsx in the codesandbox

@ldadarabl ldadarabl added bug Something isn't working needs assessment This needs to be looked at by a team member labels Feb 21, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working needs assessment This needs to be looked at by a team member
Projects
None yet
Development

No branches or pull requests

1 participant