Skip to content

[EuiContextMenu] Fix post-transition unclickable menu items#3656

Merged
thompsongl merged 4 commits intoelastic:masterfrom
thompsongl:bugfix/3547-context-menu
Jun 25, 2020
Merged

[EuiContextMenu] Fix post-transition unclickable menu items#3656
thompsongl merged 4 commits intoelastic:masterfrom
thompsongl:bugfix/3547-context-menu

Conversation

@thompsongl
Copy link
Copy Markdown
Contributor

@thompsongl thompsongl commented Jun 24, 2020

Summary

Fixes #3547, in which menu items in an EuiContextMenuPanel would become unclickable after animating in. The problem was caused by the applied animation class (e.g., .euiContextMenuPanel-txOutRight) that sets pointer-events: none; not being removed after the animation end.

This appeared only in Chromium browsers and was likely spurred on by a recent (unknown) change that resulted in a setState race condition.

The solution here is to bypass the offending state update by removing it entirely. The isTransitioning state flag was nothing more than an analog for the existence of the transitionType prop provided by the parent component and updated on the same events. Replacing isTransitioning and its setState methods with a truthy prop check simplifies logic without changing behavior.

Also fixed a bug in the docs that was causing prop type warnings in dev mode.

Checklist

- [ ] Check against all themes for compatibility in both light and dark modes
- [ ] Checked in mobile
- [ ] Checked in IE11 and Firefox
- [ ] Props have proper autodocs
- [ ] Added documentation

- [ ] Added or updated jest tests

  • Checked for breaking changes and labeled appropriately

- [ ] Checked for accessibility including keyboard-only and screenreader modes

  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_3656/

Copy link
Copy Markdown
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this functionally and browsed the code. Looks to have fixed the problem. Simple fix! Bet that was hard to track down.

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_3656/

@thompsongl thompsongl merged commit 70aa5fc into elastic:master Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EuiContextMenu is unclickable after going to nested menu

3 participants