Skip to content
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

Fix for elements sometimes not reappearing after idle #392

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JakeQZ
Copy link

@JakeQZ JakeQZ commented Sep 1, 2017

Seen in Firefox 55.0.x. The animation completion callbacks are not
necessarily called in order, and occasionally the callback for elements
being shown occurs after the callback for them being hidden a few
seconds later. This probably isn't helped by every mousemove event
resulting in a fresh call to Utils.animate until the animation is
complete. The result is that the state logic indicates the elements are
shown when in fact they are not, so mousemove does not cause them to be
re-shown.

This change simplifies the logic so that idle.active and
data.complete are true when the elements are shown or being shown, and
false when the elements are hidden or being hidden, so an animation is
triggered only whenever the desired state is not current or already
becoming current. The animation callback and data.busy is now no
longer required.

Also ensured that data.complete is initially set correctly according
to whether the element is initially hidden, and corrected what appears
to be a typo in removeEvent (should remove the mousemove and click
events, not add them).

Seen in Firefox 55.0.x.  The animation completion callbacks are not
necessarily called in order, and occasionally the callback for elements
being shown occurs after the callback for them being hidden a few
seconds later.  This probably isn't helped by every mousemove event
resulting in a fresh call to Utils.animate until the animation is
complete.  The result is that the state logic indicates the elements are
shown when in fact they are not, so mousemove does not cause them to be
re-shown.

This change simplifies the logic so that `idle.active` and
`data.complete` are true when the elements are shown or being shown, and
false when the elements are hidden or being hidden, so an animation is
triggered only whenever the desired state is not current or already
becoming current.  The animation callback and `data.busy` is now no
longer required.

Also ensured that `data.complete` is initially set correctly according
to whether the element is initially hidden, and corrected what appears
to be a typo in removeEvent (should remove the mousemove and click
events, not add them).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant