WickyNilliams / headroom.js

Give your pages some headroom. Hide your header until you need it
https://wicky.nillia.ms/headroom.js/
MIT License
10.86k stars 824 forks source link

Consider allowing freezing pin state without freezing top/not top changes #393

Open Ambient-Impact opened 3 years ago

Ambient-Impact commented 3 years ago

On a project that I'm working on, we're using the top/not top to show or hide a shadow, so that the Headroom.js-enabled element only displays the shadow when not at the top, so that it blends nicely into the top of the site when not scrolled down. We're also pinning and freezing the instance when focus enters the element via the keyboard so that a user doesn't accidentally hide it if they scroll but are still expecting keyboard input to work (we've got a search field in there). The problem with freezing is as it currently exists is that it doesn't allow us to correctly showing or hiding the shadow if the element has keyboard focus, which can look a bit strange. Is there something I could be doing instead, or is this a feature you'd consider adding?