-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Dataviews: Fix sticky table headers #59467
Conversation
Size Change: -43 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
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 the PR!
The following is how it looks on Windows OS / Chrome, and it appears to be working as expected.
a320668039e4297fede76569576663fb.mp4
However, we may need to increase the z-index of the table header so that the checkbox is not in front:
With this approach the filter controls are also sticky where previously it was only the table headers. I haven't found an approach that avoids this yet, but perhaps it's useful?
Personally, I would expect the filter control to be fixed, but I think it might be a good idea to make the filter control fixed on all layouts.
packages/dataviews/src/dataviews.js
Outdated
<div className="dataviews-wrapper"> | ||
<VStack spacing={ 3 } justify="flex-start"> | ||
<VStack spacing={ 0 } justify="flex-start"> |
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.
I'm thinking maybe we can remove this nested div. That is, it would look like this:
return (
<VStack
className="dataviews-wrapper"
spacing={ 0 }
justify="flex-start"
>
<HStack />
<ViewComponent />
<Pagination />
</VStack>
);
Personally I think that we might want to explore this more before merging, because right now the filters are few, but could be lots of them in the future. I know it's not quite easy though, from all the things I tried and searched.. |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
@ntsekouras Seems unlikely we can merge this with 100% confidence for 6.5, and it may be too late now. Do you think we should spin up a separate PR to remove the 'broken' sticky styles for 6.5? |
We could yes, but this would mean reverting this PR and bring back the issue it solved. If that's okay with you, let's do it. |
I think I've cracked it. @t-hamano was on the right path, consolidating some of the wrappers seems to be the key.
sticky.mp4 |
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.
This looks great now, thanks!
Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org> # Conflicts: # packages/dataviews/src/style.scss
I just cherry-picked this PR to the pick/wp-65-rc-2 branch to get it included in the next release #59756 |
Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org> # Conflicts: # packages/dataviews/src/style.scss
Fixes #58977.
sticky.mp4
Testing Instructions
filter bar, table headers, and pagination stickWith this approach the filter controls are also sticky where previously it was only the table headers. I haven't found an approach that avoids this yet, but perhaps it's useful? We can discuss that and investigate alternative approaches in this PR.