amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Field marked as disabled on amp-selector continues to accept on:tap events when it should not

Open shishirm opened this issue 8 years ago • 1 comments

What's the issue?

If a field is marked as disabled, it continues to take on:tap events to affect the page view

Basically, if a field is marked as disabled, any on:tap events tied to that field should also be disabled. However, as you can see from the video, the events continue to be registered and impact the other checkbox on the page.

How do we reproduce the issue?

A sample page where you can see this happening is here: https://mshishir1.herokuapp.com/shop/amp_selector_bug_1.html#development=1

This video captures the issue: https://www.youtube.com/watch?v=BmkmeiN2bL8

What browsers are affected?

All browsers

Which AMP version is affected?

Powered by AMP ⚡ HTML – Version 1522276799752 Likely existed in previous versions as well

shishirm avatar Mar 29 '18 18:03 shishirm

This is expected behavior for the tap event. tap is an AMP event defined on all elements, and so its behavior does not change with regard to input-specific properties like disabled.

You should use amp-selector's select event, which is unfortunately not documented. Sorry about that! We'll use this issue to track updating the docs. If you use on="select:..." instead of on="tap:..." you will get the behavior you expect.

cvializ avatar Mar 29 '18 22:03 cvializ