-
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
Provide a generic action to focus/reveal elements #7626
Comments
@ericlindley-g this aligns nicely with some of the FR @alanorozco is doing this sprint (#7027, #649) so I suggest |
+1 This would be great — particularly if we could smoothly animate the scrolling into view (as opposed to a "jump cut") |
This is a great idea and it seems like it's almost a requisite to make the amp-bind story really useful. One small caveat re: our current implementation of actions. Since originally only one action per event was supported, chaining actions wouldn't be a problem. Currently, action results can potentially be asynchronous so certain user expectations would not be matched since the action sequence is executed synchronously. This needs more thought to answer whether we're ok with this. If we're not, then a more robust promise-chaining mechanism is needed. This is more relevant for #649, but the case presented here made me think of this. |
@spacedino UX might be needed for the animation curve of the smooth scrolling. Chrome is also adding this feature, We might be able to just borrow the curve from their implementation. |
@sebastianbenz @ericlindley-g FYI, feature merged today, will be in Canary this week. |
Make it possible to focus/reveal specific elements via action. Here are three scenarios in which this would be very helpful:
Scroll to element after form submit success: A form adds elements to a list, on successful submit the new element should be revealed (even if it requires scrolling the page). This is necessary in case the form input field is on a different position on the page than the results.
Show last element in a sub view: amp-bind makes it possible to implement master/detail views. This would work even better if once could reveal specific elements on the detail view:
Focus form input fields in lightbox: lightboxes are great for form inputs, make it possible to set focus to a specific form input field once the lightbox opens:
//cc @ericlindley-g
The text was updated successfully, but these errors were encountered: