- Issue created by @DanChadwick
- πΊπΈUnited States DanChadwick
This patch modifies displace.js to only consider, for data-offset-top, only elements with fixed positioning. My navbar is fixed for wider viewports, but for mobile, the navbar is allowed to scroll off the top of the page (position: static). Without this change, displace.js will consider the height of the navbar event for mobile, causing the thead to be position too low on the viewport.
To make this work, I had to move the data-offset-top="" attribute from a wrapper div to the nav bar itself. This required some changes to the page and navbar templates. This could be accomplished in other ways.
I also removed the wrapper div with class="table-responsive" from the views-view--table.twig template to allow the sticky position property to work. Sticky is incompatible with a parent h-offset:auto property.
- Status changed to Needs work
6 months ago 12:14pm 18 July 2024 Hey Dan, thanks for the issue/explanation and the patch, not sure what to do with the patch since it's against the core.
That aside, we are not supporting anything less than 10.3 with Radix 6, so that's covered.
I updated the classsticky-header
but for now kepttable-responsive
class since that's needed on Bootstrap sidePlease take a look and let me know what you think
-
doxigo β
committed b40bc39a on 6.0.x
Issue #3458866 by DanChadwick, doxigo: Drupal 10.3 changes the sticky...
-
doxigo β
committed b40bc39a on 6.0.x
- πΊπΈUnited States DanChadwick
Also need to remove the wrapper div to make sticky headers work.
Agree I'm not sure what to do about making the page header work when it's fixed for wide viewports and scrolls away for not. I suppose javascript could be added that dynamically adds/removes the attribute that causes displace.js to consider the element. Alternative, and awkwardly, a patch could be added to the module with instructions for using. Or we could open a core issue, but my track record with getting issues like this committed has been poor.
-
danchadwick β
committed f5a9a910 on 6.0.x
Issue #3458866 by danchadwick: Drupal 10.3 changes the sticky table...
-
danchadwick β
committed f5a9a910 on 6.0.x
- πΊπΈUnited States DanChadwick
I adjusted the component to not wrap the table with the bootstrap table-responsive div if sticky is enabled. I think this is the best we can do. If someone want's to have the nav bar work as I do, they'll have to patch core or similar.
Calling this fixed unless someone has a better idea.