Skip to content

Clean up or at least document slider events for ease of (advanced) use #1704

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

Closed
rreusser opened this issue May 18, 2017 · 5 comments
Closed

Comments

@rreusser
Copy link
Contributor

rreusser commented May 18, 2017

@alexcjohnson and I stumbled upon a nasty little subtlety in advanced usage of slider events. There are two types of sliderchange events:

  1. an event caused by direct user input (dragging the slider)
  2. an event caused by a detected change (play button changes the frame the slider controls)

There's an obscure little flag (eventData.interaction) that denotes whether the source was an interaction or not and it's critical to use this to distinguish what caused the event if you're hooking into the events directly instead of using the builtin API… API. If you don't, you get infinite loops because a frame change triggers a frame change.

This should be very clearly documented or maybe (tbh probably not) the event could be split into two so that it's actually difficult to make this error which right now, by default, causes infinite loops and is very tricky to catch if you didn't… ahem… write the slider code in the first place.

@rreusser
Copy link
Contributor Author

rreusser commented May 18, 2017

Or maybe the eventData flag should be {eventSource: 'internal' | 'interaction'} instead.

@yellooo

This comment has been minimized.

@alexcjohnson

This comment has been minimized.

@yellooo

This comment has been minimized.

@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

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

No branches or pull requests

5 participants