-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onDone not triggered on programatic call when no scroll is needed #111
Comments
You are passing |
It think this is still an issue when not targeting Here is an example showing the problem: https://codepen.io/brophdawg11/pen/exEwgX The problematic code seems to be here: https://github.com/rigor789/vue-scrollto/blob/master/src/scrollTo.js#L193 In our specific use case, we're promisify-ing this library through a mixin, and in the case that an element is in the viewport, the promise will never resolve, unless we implement the same logic for checking vieport presence: export default {
methods: {
$scrollToElement(element) {
return new Promise((resolve) => {
VueScrollTo.scrollTo(element, 500, {
onDone: resolve,
onCancel: resolve,
force: false,
});
});
},
},
}; I'm going to try to get a PR together to fix this now |
Can the PR be integrated please? I really need this fix. |
@rigor789 Sorry but this didn't fix my problem because issue also exists with |
Please check whether 'onDone' is defined before calling! |
There is a closed issue #27 considering probably same case (@ilkome did not specify whether he did it programatically). I am not sure if my message would be seen there since it is closed, sorry if I'm not doing it right.
Fiddle: https://jsfiddle.net/cfsv3dz8/
Tested on MacOS Sierra, Google Chrome Version 70.0.3538.110
The text was updated successfully, but these errors were encountered: