amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Allow autocomplete to have a custom click handler on tap

Open omar-dulaimi opened this issue 5 years ago • 2 comments

Describe the new feature or change to an existing feature you'd like to see

Hello, I have a use case that I haven't found anything that mentions it in the docs. I want to be able to run a custom click handler for each auto-complete item. This will enable me to achieve this use case.

Describe alternatives you've considered

I tried to use a single amp-script that does everything using javascript without any other amp components. It fell short and I had to redo everything using amp components, like auto complete, form, bind, etc.

Additional context

The feature I'm trying to implement is an amp autocomplete that lets you search for areas, once you click an item, a custom handler should intercept that, does some transformations and saves generated url to local storage, after that the form is submitted to the backend where the user is redirected to that specific search area they clicked on.

When this user comes back in the future, they'll find a list of their previous searches below the amp autocomplete using an amp-list component.

Hope my use case is clear enough.

omar-dulaimi avatar Sep 10 '20 17:09 omar-dulaimi

Any updates on this?

omar-dulaimi avatar Feb 21 '21 11:02 omar-dulaimi

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 19 '25 08:07 stale[bot]