-
Notifications
You must be signed in to change notification settings - Fork 31
Page skip and cancelled animation on page navigation multiple press #77
Comments
Hello @mcarreon, you can use the |
Is there any way to do it without using disabled? I'm using a custom icon
component that doesn't recognize the disabled property
…On Mon, Oct 29, 2018, 9:48 AM Julien Fradin ***@***.***> wrote:
Hello @mcarreon <https://github.com/mcarreon>, you can use the
onPageChange callback to re-enable your button. On click, use a state
entry that holds either the button can be clicked (e.g. canClick), set it
to false, and assign your disabled prop on button accordingly (!canClick).
On the onPageChange callback, re-enable the button by setting canClick
state member to true.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#77 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMuQ-Z_JcDIGMe3dIgw6HHPJClAacoJzks5upzF3gaJpZM4X-PFB>
.
|
@mcarreon Just put it in an actual But I agree there should be a state property inside the |
I made a fix for this in |
I haven't converted them to buttons yet, will do that soon, thanks for the suggestion. I tried it out, the issue still seems to happen. Is there a way to block the page index changing on method spam? The pages are double incrementing on double click I think the animation bug might be due to these lines in index.jsx, as the animation seems to cancel on a second method press. const gotoPreviousPage = (e) => {
this.stopMoving(e);
this.gotoPreviousPage();
};
const gotoNextPage = (e) => {
this.stopMoving(e);
this.gotoNextPage();
}; I'll be working on it, I'll let you know if I figure out anything |
So, has the behavior actually changed? Is there any evolution from what was done before? The index shouldn't even change before the previous animation has completed. |
Visually the behavior is the same as before, I did see the added canAnimate state toggle from true to false. |
Background
I have gotoNext() and gotoPrevious() as onClick events for buttons.
Issue
When either button is pressed multiple times before the animation completes on a unique page, the page index skips in the respective direction.
Effects
* This occurs even when looping is disabled
Possible solution
If this is cause by the events being called multiple times before they can process, is there a way to disable further click events until completion of the animation after the function is called?
The text was updated successfully, but these errors were encountered: