magic-akari / seamless-scroll-polyfill

Scroll Behavior polyfill
https://www.npmjs.com/package/seamless-scroll-polyfill
MIT License
159 stars 12 forks source link

Importing polyfill directly does not work #100

Closed 719media closed 4 years ago

719media commented 4 years ago

In latest 1.2.1 version:

Works:

import { polyfill } from 'seamless-scroll-polyfill';
...
polyfill();
window.scrollTo({
  top: 0,
});

Does not work:

import { windowScrollTo } from 'seamless-scroll-polyfill';
...
windowScrollTo({
  top: 0,
});
719media commented 4 years ago

This worked fine in 1.1.0 and 1.2.0, but broke in 1.2.1

magic-akari commented 4 years ago

Thanks!

emilycritter commented 3 years ago

I'm running into this issue in version 1.2.3 with importing elementScrollIntoView.

import { elementScrollIntoView } from 'seamless-scroll-polyfill';
...
elementScrollIntoView(el, { behavior: 'smooth' });
liho00 commented 3 years ago

I'm running into this issue in version 1.2.3 with importing elementScrollIntoView.

import { elementScrollIntoView } from 'seamless-scroll-polyfill';
...
elementScrollIntoView(el, { behavior: 'smooth' });

same issue here, safari isnt working for elementScrollIntoView, im using latest version, pls help check

magic-akari commented 3 years ago

I'm running into this issue in version 1.2.3 with importing elementScrollIntoView.

import { elementScrollIntoView } from 'seamless-scroll-polyfill';
...
elementScrollIntoView(el, { behavior: 'smooth' });

same issue here, safari isnt working for elementScrollIntoView, im using latest version, pls help check

Hi, what's the error message?

By the way, the windowScroll API changed since 2.0. You should pass window as first argument.

liho00 commented 3 years ago

I'm running into this issue in version 1.2.3 with importing elementScrollIntoView.

import { elementScrollIntoView } from 'seamless-scroll-polyfill';
...
elementScrollIntoView(el, { behavior: 'smooth' });

same issue here, safari isnt working for elementScrollIntoView, im using latest version, pls help check

Hi, what's the error message?

By the way, the windowScroll API changed since 2.0. You should pass window as first argument.

There is no error message, just does not scroll at all, but chrome is working fine, im using latest version

elementScrollIntoView should be using element right, why passing window as first argument?

magic-akari commented 3 years ago

I'm running into this issue in version 1.2.3 with importing elementScrollIntoView.

import { elementScrollIntoView } from 'seamless-scroll-polyfill';
...
elementScrollIntoView(el, { behavior: 'smooth' });

same issue here, safari isnt working for elementScrollIntoView, im using latest version, pls help check

Hi, what's the error message? By the way, the windowScroll API changed since 2.0. You should pass window as first argument.

There is no error message, just does not scroll at all, but chrome is working fine, im using latest version

elementScrollIntoView should be using element right, why passing window as first argument?

Could you provide a code sandbox please? such as https://codesandbox.io/s/scrollintoview-iframe-zcwn0

liho00 commented 3 years ago

I'm running into this issue in version 1.2.3 with importing elementScrollIntoView.

import { elementScrollIntoView } from 'seamless-scroll-polyfill';
...
elementScrollIntoView(el, { behavior: 'smooth' });

same issue here, safari isnt working for elementScrollIntoView, im using latest version, pls help check

Hi, what's the error message? By the way, the windowScroll API changed since 2.0. You should pass window as first argument.

There is no error message, just does not scroll at all, but chrome is working fine, im using latest version elementScrollIntoView should be using element right, why passing window as first argument?

Could you provide a code sandbox please? such as https://codesandbox.io/s/scrollintoview-iframe-zcwn0

May be i know the reason, because im using vite js + vue3, do you plan to support vite js in future? https://vitejs.dev/

magic-akari commented 3 years ago

I'm running into this issue in version 1.2.3 with importing elementScrollIntoView.

import { elementScrollIntoView } from 'seamless-scroll-polyfill';
...
elementScrollIntoView(el, { behavior: 'smooth' });

same issue here, safari isnt working for elementScrollIntoView, im using latest version, pls help check

Hi, what's the error message? By the way, the windowScroll API changed since 2.0. You should pass window as first argument.

There is no error message, just does not scroll at all, but chrome is working fine, im using latest version elementScrollIntoView should be using element right, why passing window as first argument?

Could you provide a code sandbox please? such as https://codesandbox.io/s/scrollintoview-iframe-zcwn0

May be i know the reason, because im using vite js + vue3, do you plan to support vite js in future? https://vitejs.dev/

I just tried Vite and Vue3 and everything seems to be OK.

The following is the simplest example. vite-project.zip