FocusOverlay icon indicating copy to clipboard operation
FocusOverlay copied to clipboard

Add scroll and resize listener

Open rhahne opened this issue 5 years ago • 0 comments

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.

rhahne avatar Dec 18 '20 13:12 rhahne