a hash id with or without leading "#" or the HTMLElement to scroll to
an optional offset in pixel
focuses the target element when scrolling finished
sets the hash in the url of the browser when scrolling finished
creates a new browser history entry instead of replacing the current with the new hash tag
the target element
Generated using TypeDoc
import { windowScrollSmoothToHash } from '@src/hylo-components/utils/usefull/usefull';
Scrolls the window smoothly vertically to an element with the given hash as id. Polyfills missing "smooth" functionality of certain browser (Safari).
Doesn't do anything if hash is empty or just "#".
Returns a promise which fulfils with the target element when the scrolling finished or with null if the target was invalid or the scrolling got interrupted by another windowScrollSmoothToHash call or a keydown event.