Skip to content

[ClickAwayListener] Is being fired without an onClick event after upgrading react and react-dom to v17 #23215

@mforman1

Description

@mforman1

On my app I have a menu that worked fine until I upgraded react and react-dom.
After upgrading react and react-dom from version 16.14.0 to version 17.0.0- on menu click, the menu flashes-it opens and closes right away.

  • 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 😯

On menu click- the menu opens and closes right away, for some reason the ClickAwayListener is being fired.

Expected Behavior 🤔

On menu click- the menu should open, on click away it should close.

Steps to Reproduce 🕹

Steps:

  1. Upgrade react and react-dom to v17.0.0
  2. Click the menu

Codesandbox:
https://codesandbox.io/s/material-ui-issue-forked-byfgm?file=/src/index.js Invalid. New repro: https://codesandbox.io/s/material-ui-issue-forked-13053?file=/src/Demo.js

Your Environment 🌎

Tech Version
Material-UI/core v4.11.0
React v17.0.0
React-dom v17.0.0
Chrome v86.0.4240.75

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: importantThis change can make a difference.scope: click away listenerThis is the name of the generic UI component, not the React module!type: bugIt doesn't behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions