Skip to content
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

Add scroll and resize listener #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add scroll and resize listener #2

wants to merge 1 commit into from

Conversation

rhahne
Copy link

@rhahne rhahne commented Dec 18, 2020

Currently the focus box does not refresh itself on a scroll or a resize event.

Add resize event listener
If the window gets resized, the focusBox element remains at the same position and won't readjust itself according to the targeted element. The new option debounceResize (enabled by default) will fix this.

Add scroll event listener
By default (scrolling on the body) the scroll event listener is not necessary. But as soon as you have another layer (Modal, Floating Message or even just an element with fixed height and overflow auto) the focusBox will not readjust itself to the corresponding target Element. The new option debounceScroll (enabled by default) will fix this.

Both of the event listeners are being triggered if the corresponding event is not being executed within 150ms. This variable is also adjustable via the new option debounceMs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant