Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[EuiDataGrid] Enabling draggable column headers causes header actions to stop working for grids within modals #8119

Closed
davismcphee opened this issue Nov 5, 2024 · 3 comments · Fixed by #8135
Assignees

Comments

@davismcphee
Copy link
Contributor

Describe the bug
When a data grid is rendered within an EuiModal, enabling draggable column headers through canDragAndDropColumns causes the header actions to stop working. The popover shows as expected, but attempting to click an action causes the popover to be hidden on mouse down and the action not to run.

Impact and severity
The new draggable column headers are awesome and we're updating Discover to use them (elastic/kibana#197832), but some of the consumers of our grid render it within modals, so this bug will prevent them from adopting this feature. Currently we've made it opt-in for consumers, but this hurts UX consistency in Kibana, so it would be better if we could enable it everwhere.

Environment and versions

  • EUI version: 97.3.0
  • React version: 17.0.2
  • Kibana version (if applicable): 8.17
  • Browser: Edge Chromium
  • Operating System: macOS

To Reproduce
Steps to reproduce the behavior:

  1. Render EuiDataGrid with EuiModal and pass canDragAndDropColumns.
  2. Click on a column header action menu button.
  3. Attempt to click a header action, e.g. "Move left".
  4. The action doesn't run.

Expected behavior
The column header action menu should work when rendered within EuiModal and using canDragAndDropColumns.

Minimum reproducible sandbox
https://codesandbox.io/p/sandbox/young-rain-rxkk38

Screenshots
Image

@mgadewoll
Copy link
Contributor

mgadewoll commented Nov 12, 2024

@davismcphee Thanks for raising this! 🙏
I can confirm that it's reproducible and it's related to this change here. The condition for the custom "blur" event doesn't always work as expected.

@mgadewoll mgadewoll removed the ⚠️ needs validation For bugs that need confirmation as to whether they're reproducible label Nov 12, 2024
@mgadewoll mgadewoll self-assigned this Nov 12, 2024
@mgadewoll
Copy link
Contributor

mgadewoll commented Nov 14, 2024

@davismcphee Besides this bug, we we're wondering what's the use case for EuiDataGrid inside modals? Generally we're discouraging complex content inside modals in favor of flyouts instead. (as stated on the docs here).

@davismcphee
Copy link
Contributor Author

davismcphee commented Nov 14, 2024

@mgadewoll Thanks for fixing it! The main use case I'm aware of (and how we caught this) is for Timeline, where a Discover like experience is embedded in a modal across the Security solution. Timeline is maintained by @elastic/security-threat-hunting-investigations, but they use some of our components including the Discover data grid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants