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

On touch screens on-tap functions will still fire on disabled buttons #4685

Closed
1 of 6 tasks
rosemariesadler opened this issue Jun 13, 2017 · 2 comments
Closed
1 of 6 tasks

Comments

@rosemariesadler
Copy link

Description

On touch screens on-tap functions will still fire on disabled buttons

Live Demo

http://jsbin.com/yeloki/edit

Steps to Reproduce

  1. Create my-elementwhich has a button in it
  2. Give the button an on-tap property and set the button disabled property
  3. Put Chrome in responsive mode (or use an actual touch screen)
  4. Tap the button

Expected Results

Nothing happens

Actual Results

The tap function will fire

Browsers Affected

  • Chrome
  • Firefox
  • Edge (Unknown)
  • Safari 9 (Unknown)
  • Safari 8 (Unknown)
  • IE 11 (Unknown)

Versions

  • Polymer: v1.9.1
  • webcomponents: v0.7.23
@a1626
Copy link

a1626 commented Jun 15, 2017

I don't know i've built cordova apps using v1.7.0 and have not faced this issue.

But here are some simple workarounds for you to use:

  • Add a simple css

    button[disabled] {
      pointer-events: none;
    }
    
  • Change on-tap to on-click

FYI, in your bin you are using Polymer 2.x instead of 1.9.1 as mentioned.

@dfreedm
Copy link
Member

dfreedm commented Feb 22, 2018

This should be rather easy to fix by checking the disabled property of the element we are about to dispatch the tap to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants