You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

seamless-scroll-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

seamless-scroll-polyfill - npm Package Compare versions

Comparing version

to
2.1.2

test/box.html

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [2.1.2](https://github.com/magic-akari/seamless-scroll-polyfill/compare/v2.1.1...v2.1.2) (2021-09-13)
### Bug Fixes
* call scroll directly to avoid loop deps ([c61cf19](https://github.com/magic-akari/seamless-scroll-polyfill/commit/c61cf19b0e8a47bc2f91da8a9a1fa972eb5c73f3))
## [2.1.1](https://github.com/magic-akari/seamless-scroll-polyfill/compare/v2.1.0...v2.1.1) (2021-09-11)

@@ -2,0 +9,0 @@

7

lib/bundle.js

@@ -145,6 +145,5 @@ (function (global, factory) {

}
var originalFunc = getOriginalMethod(Object.getPrototypeOf(element), "scroll", elementScrollXY);
var originalBoundFunc = originalFunc.bind(element);
var method = elementScrollXY.bind(element);
if (options.behavior !== "smooth") {
originalBoundFunc(targetX, targetY);
method(targetX, targetY);
return;

@@ -156,3 +155,3 @@ }

};
var context = __assign(__assign({}, config), { timeStamp: now(), startX: startX, startY: startY, targetX: targetX, targetY: targetY, rafId: 0, method: originalBoundFunc, callback: removeEventListener });
var context = __assign(__assign({}, config), { timeStamp: now(), startX: startX, startY: startY, targetX: targetX, targetY: targetY, rafId: 0, method: method, callback: removeEventListener });
var cancelScroll = function () {

@@ -159,0 +158,0 @@ window.cancelAnimationFrame(context.rafId);

@@ -15,3 +15,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).seamless={})}(this,(function(e){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var t=function(){return(t=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function n(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,l=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=l.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}return i}var o=function(e){return void 0===e||"auto"===e||"instant"===e||"smooth"===e};function r(e,t){this.scrollLeft=e,this.scrollTop=t}var l=function(e,t,n){return void 0===n&&(n="cannot convert to dictionary."),"Failed to execute '"+e+"' on '"+t+"': "+n},i=function(e,t,n){return l(e,t,"The provided value '"+n+"' is not a valid enum value of type ScrollBehavior.")},c=function(e,t,n){var o,r="__seamless__$$"+t+"$$__backup__";if(e[r]||(e[r]=e[t]||(e[t]=n)),null===(o=e[r])||void 0===o?void 0:o.__isPolyfill)throw new Error("unexpected_method");return e[r]},u=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)},a=function(){return"scrollBehavior"in window.document.documentElement.style},f=function(e){Object.defineProperty(e,"__isPolyfill",{value:!0})},s=function(e){[HTMLElement.prototype,SVGElement.prototype,Element.prototype].forEach((function(t){e(t)}))},d=function(e){return e.ownerDocument.scrollingElement||e.ownerDocument.documentElement},v=function(e){return.5*(1-Math.cos(Math.PI*e))},w=function(){var e,t,n;return null!==(n=null===(t=null===(e=window.performance)||void 0===e?void 0:e.now)||void 0===t?void 0:t.call(e))&&void 0!==n?n:window.Date.now()},m=function(e){var t=(w()-e.timeStamp)/(e.duration||500);if(t>1)return e.method(e.targetX,e.targetY),void e.callback();var n=(e.timingFunc||v)(t),o=e.startX+(e.targetX-e.startX)*n,r=e.startY+(e.targetY-e.startY)*n;e.method(o,r),e.rafId=window.requestAnimationFrame((function(){m(e)}))},h=function(e){return isFinite(e)?Number(e):0},p=function(e){return function(a,f,s){var v,p=n((v=a).window===v?[d(a.document.documentElement),"Window"]:[a,"Element"],2),y=p[0],g=p[1],b=null!=f?f:{};if(!u(b))throw new TypeError(l(e,g));if(!o(b.behavior))throw new TypeError(i(e,g,b.behavior));"scrollBy"===e&&(b.left=h(b.left)+y.scrollLeft,b.top=h(b.top)+y.scrollTop),function(e,n,o){var l,i;if(function(e){var t;return null!==(t=e.isConnected)&&void 0!==t?t:!(e.ownerDocument&&1&e.ownerDocument.compareDocumentPosition(e))}(e)){var u=e.scrollLeft,a=e.scrollTop,f=h(null!==(l=n.left)&&void 0!==l?l:u),s=h(null!==(i=n.top)&&void 0!==i?i:a);if(f!==u||s!==a){var d=c(Object.getPrototypeOf(e),"scroll",r).bind(e);if("smooth"===n.behavior){var v=function(){window.removeEventListener("wheel",y),window.removeEventListener("touchmove",y)},p=t(t({},o),{timeStamp:w(),startX:u,startY:a,targetX:f,targetY:s,rafId:0,method:d,callback:v}),y=function(){window.cancelAnimationFrame(p.rafId),v()};window.addEventListener("wheel",y,{passive:!0,once:!0}),window.addEventListener("touchmove",y,{passive:!0,once:!0}),m(p)}else d(f,s)}}}(y,b,s)}},y=p("scroll"),g=p("scrollTo"),b=p("scrollBy"),T=y,E=g,S=b,P=y,V=g,B=b,L=function(e){switch(e){case"horizontal-tb":case"lr":case"lr-tb":case"rl":case"rl-tb":return 0;case"vertical-rl":case"tb":case"tb-rl":return 1;case"vertical-lr":case"tb-lr":return 2;case"sideways-rl":return 3;case"sideways-lr":return 4}return 0},_=function(e,t,o,r){var l,i=0;switch(t||(i^=2),e){case 0:i=i>>1|(1&i)<<1,o=(l=n([r,o],2))[0],r=l[1];break;case 1:case 3:i^=1;break;case 4:i^=2}return[i,o,r]},D=function(e){return 1==(1&_(L(e.writingMode),"rtl"!==e.direction,void 0,void 0)[0])},I=function(e,t,n,o,r,l,i){return 0!==e?e:r<t&&l>n||r>t&&l<n?null:r<=t&&i<=o||l>=n&&i>=o?2:l>n&&i<o||r<t&&i>o?3:null},M=function(e){return"visible"!==e&&"clip"!==e},W=function(e,t){return(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth)&&(M(t.overflowY)||M(t.overflowX)||e===d(e))},k=function(e){var t=e.parentNode,n=e.parentElement;if(null===n&&null!==t){if(11===t.nodeType)return t.host;if(9===t.nodeType)return function(e){var t;try{return(null===(t=e.ownerDocument.defaultView)||void 0===t?void 0:t.frameElement)||null}catch(e){return null}}(e)}return n},x=function(e,t,n){return e<t?t:e>n?n:e},H=function(e,t,n){switch(e){case 1:return(t+n)/2;case 3:return n;case 2:case 0:return t}},j=function(e,t){var o,r,l,i=null===(o=e.ownerDocument.defaultView)||void 0===o?void 0:o.visualViewport,c=n(e===d(e)?[0,0,null!==(r=null==i?void 0:i.width)&&void 0!==r?r:e.clientWidth,null!==(l=null==i?void 0:i.height)&&void 0!==l?l:e.clientHeight]:[t.left,t.top,e.clientWidth,e.clientHeight],4),u=c[0],a=c[1],f=c[2],s=c[3],v=u+e.clientLeft,w=a+e.clientTop;return[w,v+f,w+s,v]},O=function(e,t){var o=[],r=e.ownerDocument,l=r.defaultView;if(!l)return o;for(var i=window.getComputedStyle(e),c="rtl"!==i.direction,u=n(function(e,t,o){var r=n(_(t,o,e.block||"start",e.inline||"nearest"),3),l=r[0];return[r[1],r[2]].map((function(e,t){switch(e){case"center":return 1;case"nearest":return 0;default:return"start"===e==!(l>>t&1)?2:3}}))}(t,L(i.writingMode||i.getPropertyValue("-webkit-writing-mode")||i.getPropertyValue("-ms-writing-mode")),c),2),a=u[0],f=u[1],s=n(function(e,t,n){var o,r=t.top,l=t.right,i=t.bottom,c=t.left,u=(o=e.ownerDocument,["scroll-margin","scroll-snap-margin"].filter((function(e){return e in o.documentElement.style}))[0]);if(!u)return[r,l,i,c];var a=function(e){var t=n.getPropertyValue(u+"-"+e);return parseInt(t,10)||0};return[r-a("top"),l+a("right"),i+a("bottom"),c-a("left")]}(e,e.getBoundingClientRect(),i),4),d=s[0],v=s[1],w=s[2],m=s[3],h=k(e);null!==h;h=k(h)){if(r!==h.ownerDocument){if(!(l=(r=h.ownerDocument).defaultView))break;var p=h.getBoundingClientRect(),y=p.left,g=p.top;d+=g,v+=y,w+=g,m+=y}var b=l.getComputedStyle(h);if("fixed"===b.position)break;if(W(h,b)){var T=h.getBoundingClientRect(),E=n(j(h,T),4),S=E[0],P=E[1],V=E[2],B=E[3],M=H(a,B,P),O=H(f,S,V),X=I(a,B,P,h.clientWidth,m,v,v-m),Y=I(f,S,V,h.clientHeight,d,w,w-d),C=(null===X?M:H(X,m,v))-M,F=(null===Y?O:H(Y,d,w))-O,$=D(b)?x(C,-h.scrollWidth+h.clientWidth-h.scrollLeft,-h.scrollLeft):x(C,-h.scrollLeft,h.scrollWidth-h.clientWidth-h.scrollLeft),R=x(F,-h.scrollTop,h.scrollHeight-h.clientHeight-h.scrollTop);o.push([h,{left:h.scrollLeft+$,top:h.scrollTop+R,behavior:t.behavior}]),d=Math.max(d-R,S),v=Math.min(v-$,P),w=Math.min(w-R,V),m=Math.max(m-$,B)}}return o},X=function(e,t,r){var l=t||{};if(!o(l.behavior))throw new TypeError(i("scrollIntoView","Element",l.behavior));O(e,l).forEach((function(e){var t=n(e,2),o=t[0],l=t[1];T(o,l,r)}))},Y=X,C=function(e,t){return function(n){if(!a()){var o={scroll:y,scrollTo:g,scrollBy:b}[e];t((function(t){t[e]=function(){var e=arguments;if(1!==arguments.length){var t=e[0],r=e[1];o(this,{left:t,top:r})}else o(this,e[0],n)},f(t[e])}))}}},F=C("scroll",s),$=C("scrollTo",s),R=C("scrollBy",s),A=function(e){e(window)},N=C("scroll",A),q=C("scrollTo",A),z=C("scrollBy",A),G=function(e){if(!a()){var t=c(window.HTMLElement.prototype,"scrollIntoView");s((function(n){n.scrollIntoView=function(){var n=arguments,o=n[0];1===n.length&&u(o)?Y(this,o,e):t.apply(this,n)},f(n.scrollIntoView)}))}};e.elementScroll=T,e.elementScrollBy=S,e.elementScrollByPolyfill=R,e.elementScrollIntoView=Y,e.elementScrollIntoViewPolyfill=G,e.elementScrollPolyfill=F,e.elementScrollTo=E,e.elementScrollToPolyfill=$,e.polyfill=function(e){a()||(F(e),$(e),R(e),G(e),N(e),q(e),z(e))},e.scroll=y,e.scrollBy=b,e.scrollIntoView=X,e.scrollTo=g,e.windowScroll=P,e.windowScrollBy=B,e.windowScrollByPolyfill=z,e.windowScrollPolyfill=N,e.windowScrollTo=V,e.windowScrollToPolyfill=q,Object.defineProperty(e,"__esModule",{value:!0})}));
***************************************************************************** */var t=function(){return(t=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function n(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,l=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=l.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}return i}var o=function(e){return void 0===e||"auto"===e||"instant"===e||"smooth"===e};function r(e,t){this.scrollLeft=e,this.scrollTop=t}var l=function(e,t,n){return void 0===n&&(n="cannot convert to dictionary."),"Failed to execute '"+e+"' on '"+t+"': "+n},i=function(e,t,n){return l(e,t,"The provided value '"+n+"' is not a valid enum value of type ScrollBehavior.")},c=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)},u=function(){return"scrollBehavior"in window.document.documentElement.style},a=function(e){Object.defineProperty(e,"__isPolyfill",{value:!0})},f=function(e){[HTMLElement.prototype,SVGElement.prototype,Element.prototype].forEach((function(t){e(t)}))},s=function(e){return e.ownerDocument.scrollingElement||e.ownerDocument.documentElement},d=function(e){return.5*(1-Math.cos(Math.PI*e))},v=function(){var e,t,n;return null!==(n=null===(t=null===(e=window.performance)||void 0===e?void 0:e.now)||void 0===t?void 0:t.call(e))&&void 0!==n?n:window.Date.now()},w=function(e){var t=(v()-e.timeStamp)/(e.duration||500);if(t>1)return e.method(e.targetX,e.targetY),void e.callback();var n=(e.timingFunc||d)(t),o=e.startX+(e.targetX-e.startX)*n,r=e.startY+(e.targetY-e.startY)*n;e.method(o,r),e.rafId=window.requestAnimationFrame((function(){w(e)}))},m=function(e){return isFinite(e)?Number(e):0},h=function(e){return function(u,a,f){var d,h=n((d=u).window===d?[s(u.document.documentElement),"Window"]:[u,"Element"],2),p=h[0],y=h[1],g=null!=a?a:{};if(!c(g))throw new TypeError(l(e,y));if(!o(g.behavior))throw new TypeError(i(e,y,g.behavior));"scrollBy"===e&&(g.left=m(g.left)+p.scrollLeft,g.top=m(g.top)+p.scrollTop),function(e,n,o){var l,i;if(function(e){var t;return null!==(t=e.isConnected)&&void 0!==t?t:!(e.ownerDocument&&1&e.ownerDocument.compareDocumentPosition(e))}(e)){var c=e.scrollLeft,u=e.scrollTop,a=m(null!==(l=n.left)&&void 0!==l?l:c),f=m(null!==(i=n.top)&&void 0!==i?i:u);if(a!==c||f!==u){var s=r.bind(e);if("smooth"===n.behavior){var d=function(){window.removeEventListener("wheel",p),window.removeEventListener("touchmove",p)},h=t(t({},o),{timeStamp:v(),startX:c,startY:u,targetX:a,targetY:f,rafId:0,method:s,callback:d}),p=function(){window.cancelAnimationFrame(h.rafId),d()};window.addEventListener("wheel",p,{passive:!0,once:!0}),window.addEventListener("touchmove",p,{passive:!0,once:!0}),w(h)}else s(a,f)}}}(p,g,f)}},p=h("scroll"),y=h("scrollTo"),g=h("scrollBy"),b=p,T=y,E=g,S=p,P=y,V=g,B=function(e){switch(e){case"horizontal-tb":case"lr":case"lr-tb":case"rl":case"rl-tb":return 0;case"vertical-rl":case"tb":case"tb-rl":return 1;case"vertical-lr":case"tb-lr":return 2;case"sideways-rl":return 3;case"sideways-lr":return 4}return 0},L=function(e,t,o,r){var l,i=0;switch(t||(i^=2),e){case 0:i=i>>1|(1&i)<<1,o=(l=n([r,o],2))[0],r=l[1];break;case 1:case 3:i^=1;break;case 4:i^=2}return[i,o,r]},_=function(e){return 1==(1&L(B(e.writingMode),"rtl"!==e.direction,void 0,void 0)[0])},D=function(e,t,n,o,r,l,i){return 0!==e?e:r<t&&l>n||r>t&&l<n?null:r<=t&&i<=o||l>=n&&i>=o?2:l>n&&i<o||r<t&&i>o?3:null},I=function(e){return"visible"!==e&&"clip"!==e},M=function(e,t){return(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth)&&(I(t.overflowY)||I(t.overflowX)||e===s(e))},W=function(e){var t=e.parentNode,n=e.parentElement;if(null===n&&null!==t){if(11===t.nodeType)return t.host;if(9===t.nodeType)return function(e){var t;try{return(null===(t=e.ownerDocument.defaultView)||void 0===t?void 0:t.frameElement)||null}catch(e){return null}}(e)}return n},k=function(e,t,n){return e<t?t:e>n?n:e},x=function(e,t,n){switch(e){case 1:return(t+n)/2;case 3:return n;case 2:case 0:return t}},H=function(e,t){var o,r,l,i=null===(o=e.ownerDocument.defaultView)||void 0===o?void 0:o.visualViewport,c=n(e===s(e)?[0,0,null!==(r=null==i?void 0:i.width)&&void 0!==r?r:e.clientWidth,null!==(l=null==i?void 0:i.height)&&void 0!==l?l:e.clientHeight]:[t.left,t.top,e.clientWidth,e.clientHeight],4),u=c[0],a=c[1],f=c[2],d=c[3],v=u+e.clientLeft,w=a+e.clientTop;return[w,v+f,w+d,v]},X=function(e,t){var o=[],r=e.ownerDocument,l=r.defaultView;if(!l)return o;for(var i=window.getComputedStyle(e),c="rtl"!==i.direction,u=n(function(e,t,o){var r=n(L(t,o,e.block||"start",e.inline||"nearest"),3),l=r[0];return[r[1],r[2]].map((function(e,t){switch(e){case"center":return 1;case"nearest":return 0;default:return"start"===e==!(l>>t&1)?2:3}}))}(t,B(i.writingMode||i.getPropertyValue("-webkit-writing-mode")||i.getPropertyValue("-ms-writing-mode")),c),2),a=u[0],f=u[1],s=n(function(e,t,n){var o,r=t.top,l=t.right,i=t.bottom,c=t.left,u=(o=e.ownerDocument,["scroll-margin","scroll-snap-margin"].filter((function(e){return e in o.documentElement.style}))[0]);if(!u)return[r,l,i,c];var a=function(e){var t=n.getPropertyValue(u+"-"+e);return parseInt(t,10)||0};return[r-a("top"),l+a("right"),i+a("bottom"),c-a("left")]}(e,e.getBoundingClientRect(),i),4),d=s[0],v=s[1],w=s[2],m=s[3],h=W(e);null!==h;h=W(h)){if(r!==h.ownerDocument){if(!(l=(r=h.ownerDocument).defaultView))break;var p=h.getBoundingClientRect(),y=p.left,g=p.top;d+=g,v+=y,w+=g,m+=y}var b=l.getComputedStyle(h);if("fixed"===b.position)break;if(M(h,b)){var T=h.getBoundingClientRect(),E=n(H(h,T),4),S=E[0],P=E[1],V=E[2],I=E[3],X=x(a,I,P),Y=x(f,S,V),j=D(a,I,P,h.clientWidth,m,v,v-m),C=D(f,S,V,h.clientHeight,d,w,w-d),F=(null===j?X:x(j,m,v))-X,O=(null===C?Y:x(C,d,w))-Y,$=_(b)?k(F,-h.scrollWidth+h.clientWidth-h.scrollLeft,-h.scrollLeft):k(F,-h.scrollLeft,h.scrollWidth-h.clientWidth-h.scrollLeft),R=k(O,-h.scrollTop,h.scrollHeight-h.clientHeight-h.scrollTop);o.push([h,{left:h.scrollLeft+$,top:h.scrollTop+R,behavior:t.behavior}]),d=Math.max(d-R,S),v=Math.min(v-$,P),w=Math.min(w-R,V),m=Math.max(m-$,I)}}return o},Y=function(e,t,r){var l=t||{};if(!o(l.behavior))throw new TypeError(i("scrollIntoView","Element",l.behavior));X(e,l).forEach((function(e){var t=n(e,2),o=t[0],l=t[1];b(o,l,r)}))},j=Y,C=function(e,t){return function(n){if(!u()){var o={scroll:p,scrollTo:y,scrollBy:g}[e];t((function(t){t[e]=function(){var e=arguments;if(1!==arguments.length){var t=e[0],r=e[1];o(this,{left:t,top:r})}else o(this,e[0],n)},a(t[e])}))}}},F=C("scroll",f),O=C("scrollTo",f),$=C("scrollBy",f),R=function(e){e(window)},A=C("scroll",R),N=C("scrollTo",R),q=C("scrollBy",R),z=function(e){if(!u()){var t=function(e,t,n){var o,r="__seamless__$$"+t+"$$__backup__";if(e[r]||(e[r]=e[t]||(e[t]=n)),null===(o=e[r])||void 0===o?void 0:o.__isPolyfill)throw new Error("unexpected_method");return e[r]}(window.HTMLElement.prototype,"scrollIntoView");f((function(n){n.scrollIntoView=function(){var n=arguments,o=n[0];1===n.length&&c(o)?j(this,o,e):t.apply(this,n)},a(n.scrollIntoView)}))}};e.elementScroll=b,e.elementScrollBy=E,e.elementScrollByPolyfill=$,e.elementScrollIntoView=j,e.elementScrollIntoViewPolyfill=z,e.elementScrollPolyfill=F,e.elementScrollTo=T,e.elementScrollToPolyfill=O,e.polyfill=function(e){u()||(F(e),O(e),$(e),z(e),A(e),N(e),q(e))},e.scroll=p,e.scrollBy=g,e.scrollIntoView=Y,e.scrollTo=y,e.windowScroll=S,e.windowScrollBy=V,e.windowScrollByPolyfill=q,e.windowScrollPolyfill=A,e.windowScrollTo=P,e.windowScrollToPolyfill=N,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=bundle.min.js.map

@@ -1,2 +0,2 @@

import { checkBehavior, failedExecute, getOriginalMethod, failedExecuteInvalidEnumValue, isObject, elementScrollXY, scrollingElement, } from "./common.js";
import { checkBehavior, elementScrollXY, failedExecute, failedExecuteInvalidEnumValue, isObject, scrollingElement, } from "./common.js";
import { now, step } from "./scroll-step.js";

@@ -27,6 +27,5 @@ // https://drafts.csswg.org/cssom-view/#normalize-non-finite-values

}
const originalFunc = getOriginalMethod(Object.getPrototypeOf(element), "scroll", elementScrollXY);
const originalBoundFunc = originalFunc.bind(element);
const method = elementScrollXY.bind(element);
if (options.behavior !== "smooth") {
originalBoundFunc(targetX, targetY);
method(targetX, targetY);
return;

@@ -46,3 +45,3 @@ }

rafId: 0,
method: originalBoundFunc,
method,
callback: removeEventListener,

@@ -49,0 +48,0 @@ };

@@ -5,3 +5,3 @@ {

"description": "Smooth Scroll behavior polyfill",
"version": "2.1.1",
"version": "2.1.2",
"author": {

@@ -8,0 +8,0 @@ "name": "Dustan Kasten",

import {
checkBehavior,
elementScrollXY,
failedExecute,
getOriginalMethod,
failedExecuteInvalidEnumValue,
isObject,
elementScrollXY,
scrollingElement,

@@ -45,7 +44,6 @@ } from "./common.js";

const originalFunc = getOriginalMethod(Object.getPrototypeOf(element), "scroll", elementScrollXY);
const originalBoundFunc = originalFunc.bind(element);
const method = elementScrollXY.bind(element);
if (options.behavior !== "smooth") {
originalBoundFunc(targetX, targetY);
method(targetX, targetY);
return;

@@ -67,3 +65,3 @@ }

rafId: 0,
method: originalBoundFunc,
method,
callback: removeEventListener,

@@ -70,0 +68,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet