Last active
May 15, 2018 01:54
-
-
Save jmshal/4c7dd81a61adcb648944a16b0fac717f to your computer and use it in GitHub Desktop.
Electron `position: sticky` shim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.addEventListener('scroll', (event) => { | |
| const stickyShim = event.target.querySelector('.sticky-shim'); | |
| if (stickyShim) { | |
| stickyShim.style.position = 'relative'; | |
| stickyShim.offsetHeight; | |
| stickyShim.style.position = ''; | |
| } | |
| }, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment