rh-secondary-nav component - stickiness #587
Replies: 1 comment 1 reply
-
I can see a possible long-term solution being to create a wrapper component around both Example: <rh-nav-position>
<rh-nav>...</rh-nav>
<rh-secondary-nav>...</rh-secondary-nav>
</rh-nav-position> This For the time being because Feel free to look at the JS code in the spandx proxy demo in secondary-nav. I'm positive that this demo code is not production ready as there may be more thoughts on how to better handle throttling of the scroll event, and it does not take into consideration anything that is placed above the primary nav increasing the spacing between the top and the navs. This was workable for demo purposes at the time. Essentially all it is doing is swapping the Any code written for RHDC though would definitely inform how we would/should build the |
Beta Was this translation helpful? Give feedback.
-
Hey all - I'm starting work on rebuilding redhat.com secondary navs using the new rh-secondary-nav component. 🎉
Currently, on pages with the main nav but no secondary nav, the main nav is sticky as the user scrolls. On pages with the main nav and a secondary nav, the main nav loses its stickiness and the secondary nav is sticky on scroll. (Example here: https://www.redhat.com/en/technologies/management/ansible)
It sounds like there's nothing within the rh-secondary-nav component to handle that kind of functionality, so I would need to write my own JS to handle that. I was curious the team's thoughts on that. I would be writing separate JS that is basically essential for the component to work as expected with the RH main nav. Could that JS be 'part' of the component itself?
Beta Was this translation helpful? Give feedback.
All reactions