Fixes the unwanted shift of the viewport when an element outside the vieport receives focus and the browser shifts the vieport to put the focused element into the viewport.

It sets the scrollLeft and/or the scrollTop of the target element back to the initial values every time the scroll event is triggered on the document root element.

Constructors

Properties

Constructors

Properties

left: number | boolean = 0

The initial scrollLeft value. Set to false to disable it.

target: string | HTMLElement = 'html'

The target element eather as css query string or HTMLElement.

top: number | boolean = false

The initial scrollTop value. Set to false to disable it.

Generated using TypeDoc