Skip to content

[Select] No longer listens to click events #18655

@aceluby

Description

@aceluby
  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

All my tests fail in version 4.7.1 when I fire click events to start the Select process. I instead have to use 'mouseDown' events in order for tests to work properly. The PR that impacted this is here: #17978

Expected Behavior 🤔

I'd expect click events to bring up the dropdown menu as it was in previous versions

Steps to Reproduce 🕹

https://codesandbox.io/s/create-react-app-2pyv7?fontsize=14

Steps:

  1. Create a dropdown menu as per the docs
  2. Test it using react-testing-library fireEvent.click
  3. Clicks no longer register (where they did before)
  4. Change the click event to mouseDown and it will work

Context 🔦

I have multiple tests where I click select elements as part of the test. Every one of those tests now break as part of the newest release. To me, this feels like a breaking change without any notification the change even occurred, I had to scour through the PR to see why it had happened.

Your Environment 🌎

Tech Version
Material-UI v4.7.1
React 16.12.0
@testing-library/react 9.3.2
jest 24.0.22

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: selectChanges related to the select.testwaiting for 👍Waiting for upvotes. Open for community feedback and needs more interest to be worked on.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions