-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[amp-story-player] Opt-out of animation in go() / show() #30889
Comments
What we need:
A logic that could work by default is: "when a user script programmatically calls Then, we can have a config @ampproject/wg-stories wdyt? |
Having some level of magic behind a parameter makes it very hard for a developer to predict its behavior. Having a second (or third I forgot) parameter like |
There are some edge cases where this wouldn't work (e.g. with
Unfortunately we can't know for sure if they are using
👍🏽 I also think having mixed logic across different methods would confuse developers. I think we should get rid of the animation when calling
|
This feature request doesn't necessarily need to change the defaults, but providing the options in the API SGTM. Seems like the player currently animates only when navigating to a story that is already built, which means it's only navigating for +1 and -1. Is this problematic in any way? To me this current default makes sense and if we provide users with the API way of configuring whether to show the animation, then this will be solved. Developers can decide based on what button the user clicked, what the behavior is. Eg: // Clicking on entrypoint
player.show(e.target.getAttribute("data-story"), null, {animate: false});
// Clicking on next button
player.go(1, null, {animate: false});
This could negatively impact navigation for players that have a next and previous button, which is a primary use-case of the programmatic controls. My take on this is that we shouldn't remove these animations by default.
This can be solved with code changes so not a problem. However, changing the defaults for one method and not the other sounds confusing as you said. |
Currently using the
go()
(orshow()
, since it usesgo()
internally) will show the swiping animation. Sometimes this is undesirable and would be ideal to opt-out of it. e.g. a carousel entry point.@ampproject/wg-stories
The text was updated successfully, but these errors were encountered: