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

Support AMP.navigateTo action #8976

Closed
gilbox opened this issue Apr 26, 2017 · 12 comments · Fixed by #9932
Closed

Support AMP.navigateTo action #8976

gilbox opened this issue Apr 26, 2017 · 12 comments · Fixed by #9932
Assignees
Labels
Projects

Comments

@gilbox
Copy link
Contributor

gilbox commented Apr 26, 2017

What's the issue?

This is a feature request. We'd like to be able to have a drop-down menu that triggers going to a new URL as if you'd clicked on a link.

Here's the non-AMP version of the page and the options (you must use small viewport to see them) are at the bottom of the page and they allow you to change the language and currency type.

The feature could look something like this:

<select on="change:AMP.goToURL(event.value)">
  <option value="https://www.airbnb.com/asdf">foo</option>
  <option value="https://www.airbnb.com/xyzw">bar</option>
</select>

This is a screenshot from our non-AMP page to illustrate the feature:

image

@dreamofabear
Copy link

Seems reasonable since anchor tags don't work inside select or option. We already have a AMP.goBack action.

Changing title since this isn't really specific to amp-bind.

/cc @ericlindley-g @dvoytenko

@dreamofabear dreamofabear changed the title amp-bind: Support goToURL Support AMP.goToURL action Apr 27, 2017
@dvoytenko
Copy link
Contributor

I can see this. @choumx is our user-action control strong enough however for this use case (asking because I have no idea)?

@dreamofabear
Copy link

Fair point. Since navigation is such a big action, maybe we should restrict its usage to certain elements/events. I'll bring this up during next design review.

@jridgewell
Copy link
Contributor

We have a second request for this #9206.

@aghassemi
Copy link
Contributor

@choumx @jridgewell #8515 (amp-exit) would also handle this use-case (I personally don't mind having both, each has its own pros and cons. amp-exit is more flexible but less ergonomic than goToUrl)

since I am voicing my opinion, I slightly prefer navigateTo to goTourl for wording.

@dreamofabear
Copy link

dreamofabear commented May 10, 2017

@aghassemi Thanks for the heads up. Though, amp-exit would share the same "trust" issue discussed in #8901 (comment) if it uses AMP Actions as a trigger.

Good suggestion on navigateTo().

@ericlindley-g ericlindley-g added this to Needs Triage in UI May 12, 2017
@ericlindley-g ericlindley-g moved this from Needs Triage to Backlog (shortlist) in UI May 23, 2017
@Rahul007shah
Copy link

Hi Team, Is there any update for the navigateTo() feature? Looking forward to embed this feature in Priceline.com Google-AMP conversion.

Thanks
Rahul

@dreamofabear
Copy link

Hi Rahul, thanks for reaching out. It's on our radar and we're hoping to tackle the prerequisite "trust" feature in the next sprint, after which navigateTo will be a simple change.

@dreamofabear dreamofabear self-assigned this Jun 2, 2017
@dreamofabear dreamofabear modified the milestones: Sprint H1 June, New FRs Jun 2, 2017
@dreamofabear dreamofabear changed the title Support AMP.goToURL action Support AMP.navigateTo action Jun 14, 2017
This was referenced Jun 14, 2017
@ericlindley-g ericlindley-g moved this from Backlog (shortlist) to Implemented (needs ABE sample) in UI Jun 16, 2017
@Rahul007shah
Copy link

Hi Team,

Please provide demo and documentation for AMP.navigateTo component.

Thanks,
Rahul

@aghassemi
Copy link
Contributor

Hi @Rahul007shah

Documentation is here: https://github.com/ampproject/amphtml/blob/master/spec/amp-actions-and-events.md#special-targets

Example is here: https://github.com/ampproject/amphtml/blob/master/examples/standard-actions.amp.html

@wudizhuzhuxia
Copy link

Hi Team,I have a question about goBack?
<button on="tab:AMP.goBack"></button>
Is that the correct example above? If it‘s not right.
Please provide demo and documentation for AMP.goBack component.
Thanks!

@aghassemi
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
UI
  
Implemented (needs ABE sample)
Development

Successfully merging a pull request may close this issue.

8 participants