Skip to content

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