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] bug fixes #4706

Merged

Conversation

chandlerprall
Copy link
Contributor

@chandlerprall chandlerprall commented Apr 13, 2021

Summary

[EuiDataGrid] Column action menu can freeze Chrome browser

Fixes #4641 by only responding to key events when they are triggered on an element in the grid's DOM, ignoring events React bubbles through portals.

[EuiDataGrid] Clicking a column header twice makes it impossible to close it via outside click

Fixes #4588 by moving all datagrid header cell contents into the popover's anchor button

[EuiDataGrid] Performance issue when row count changes while pagination is enabled

Fixes #4532 (and another bug) by resetting the grid's height to its container size instead of unsetting+rerender+recalculate the container size. The second bug was in that recalculate step, or more correctly that it wasn't triggered at all.

Checklist

- [ ] Check against all themes for compatibility in both light and dark modes
- [ ] Checked in mobile

  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs and playground toggles
    - [ ] Added documentation
    - [ ] Checked Code Sandbox works for the any docs examples
    - [ ] 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

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

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

[EuiDataGrid] Column action menu can freeze Chrome browser

Confirmed this is fixed. The issue states using the arrow keys for list navigation, but that doesn't actually work. Tabbing does, however.

[EuiDataGrid] Clicking a column header twice makes it impossible to close it via outside click

Confirmed this is fixed. Agree that this will be useful in other instances of EuiPopover.

[EuiDataGrid] Performance issue when row count changes while pagination is enabled

Encountered the issue below. Toggling fullscreen does not reset height to the correct size.

Screen Cast 2021-04-13 at 11 40 39 AM

@chandlerprall
Copy link
Contributor Author

Encountered the issue below. Toggling fullscreen does not reset height to the correct size.

@thompsongl pushed a fix to ignore container size when fullscreen

@thompsongl
Copy link
Contributor

thompsongl commented Apr 13, 2021

pushed a fix to ignore container size when fullscreen

🧐 I don't think it got pushed

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

LGTM
Latest commit resolves the fullscreen issue while fixing the height change bug.

Don't forget CL entries

@kibanamachine
Copy link

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

…l to the anchor; Enhance EuiDataGrid to treat all of the header button as part of its popover anchor"

This reverts commit d5487de.
@chandlerprall
Copy link
Contributor Author

After discussing with Caroline over zoom, I've changed the solution for the second issue (#4588) to avoid adding a new prop to EuiPopover and instead moved all of the header contents into the popover anchor.

@kibanamachine
Copy link

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

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

moved all of the header contents into the popover anchor

Solves the bug, which is the main thing. Subjectively, I think it's odd that the popover arrow is centered/not aligned with the arrow icon. Is this something the two of you discussed?

@cchaos
Copy link
Contributor

cchaos commented Apr 14, 2021

Yes we did discuss, and for me, it was a tradeoff between a slight design aesthetic and further complicating and already complicated component. It also makes a little more sense to point to the middle of the cell since the whole cell IS the button. It think the main thing now is that since the button is only a small portion of the height of the cell, the popover's top position is too high:

Screen Shot 2021-04-14 at 14 36 03 PM

Whereas, if it were lowered a bit, it would align better:

Screen Shot 2021-04-14 at 14 36 23 PM

@cchaos
Copy link
Contributor

cchaos commented Apr 14, 2021

This also brings up another issue I have brought up before which is the actual position of that caret being right aligned. The problem comes when you no longer have column dividers. The carets are then closer to the next column's text than the current one's making it very confusing as to if that's the sort indicator or what.

Screen Shot 2021-04-14 at 14 48 24 PM

@chandlerprall While I was also grabbing that screenshot, one thing I did notice in your PR is that the popover also doesn't close when you resize the column.

Screen Recording 2021-04-14 at 02 50 57 PM

@chandlerprall
Copy link
Contributor Author

It think the main thing now is that since the button is only a small portion of the height of the cell, the popover's top position is too high:

Pushed a small offset

This also brings up another issue I have brought up before which is the actual position of that caret being right aligned. The problem comes when you no longer have column dividers

There's an issue for this somewhere, tho I couldn't identify it with a quick glance at our open issues

While I was also grabbing that screenshot, one thing I did notice in your PR is that the popover also doesn't close when you resize the column.

This is a side effect from preventing resizing from stealing any focus. Focus can only be prevented during the resize handle's mousedown event, which in turn disables the click event which would have closed the popover. Since the intent is for the handle to not grab focus, keeping the popover open at least feels rational? It is still closable by clicking anywhere else.

@kibanamachine
Copy link

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

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

keeping the popover open at least feels rational

We may be able to improve upon the current behavior, but I'm good merging this with the critical bugs resolved.

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@chandlerprall chandlerprall merged commit ee5d18e into elastic:master Apr 15, 2021
@chandlerprall chandlerprall deleted the bug/datagrid-fixes-for-7-13 branch April 15, 2021 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants