Closed anwerso closed 1 year ago
The primary purpose of this polyfill is to patch the 'smooth' function. The detection of 'scroll-snap-margin' is necessary for compliance with the specifications.
Additionally, it assumes the other features, such as 'scroll-snap-margin', to be functioning as intended.\ Therefore, when the parameters are not set to 'smooth', the polyfill will directly call the native method.
scrollIntoView()
without parameters not working right when you usescroll-margin/scroll-snap-margin
to adjust scrolling position. The workaround is to add an empty object. The culprit is the check to use original prototype when there are no params. As a solution we can always convert params to a new format and use polyfilled version.