-
Notifications
You must be signed in to change notification settings - Fork 844
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
Sticky headers for data grid #2959
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_2959/ |
@@ -368,7 +368,7 @@ export class EuiDataGridCell extends Component< | |||
isOpen={this.state.popoverIsOpen} | |||
ownFocus | |||
panelClassName="euiDataGridRowCell__popover" | |||
zIndex={2000} | |||
zIndex={8001} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small fix while I was in here. Fixes an issue where the popover showed below full screen.
@@ -26,7 +26,7 @@ const columns = [ | |||
id: 'email', | |||
display: ( | |||
// This is an example of an icon next to a title that still respects text truncate | |||
<EuiFlexGroup gutterSize="xs"> | |||
<EuiFlexGroup gutterSize="xs" responsive={false}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small fix to make the docs look better on mobile.
Preview documentation changes for this PR: https://eui.elastic.co/pr_2959/ |
@cchaos Mind giving this a quick check. It's mostly CSS, and would be nice to get it into the next Kibana release for use in Discover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like such an easy solution 😃 It can't really be that easy can it?
Preview documentation changes for this PR: https://eui.elastic.co/pr_2959/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a small useEffect
wrapper around the scrollTop
code.
Tested with Chrome, FF, Safari, Edge (on Mac), and Chrome for Android. Also tested this logic when the header row contains a focusable element.
Preview documentation changes for this PR: https://eui.elastic.co/pr_2959/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_2959/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into the focus-under-header issue. I understand it's a complex one. 👍
Preview documentation changes for this PR: https://eui.elastic.co/pr_2959/ |
Summary
Fixes #2464
Adds sticky header support to
EuiDataGrid
. This uses CSS'sposition: sticky
, which IE11 does not support, but seems to fail gracefully on. Because of a weird browser issue that Chromium has with with focused elements in sticky headers, some JS is needed to force the scrollable element to the top so that the first cells aren't hidden under the header.Example
IE11 degrades gracefully
Checklist
Props have proper autodocsChecked for breaking changes and labeled appropriately