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

click() doesn't invoke tap listener on a disabled element #5190

Closed
dmitryxcom opened this issue Apr 13, 2018 · 2 comments
Closed

click() doesn't invoke tap listener on a disabled element #5190

dmitryxcom opened this issue Apr 13, 2018 · 2 comments

Comments

@dmitryxcom
Copy link

JS:

Polymer({
  is: 'x-foo',
  properties: {
    disabled: {
      type: Boolean,
      reflectToAttribute: true,
    },                  
  },
  listeners: {
    'tap': 'onTap',
  },
  onTap: () => {
    console.log('clicked!');
  }
});

html:

  <x-foo></x-foo>
  <x-foo disabled></x-foo>

in v1:

normal.click() // tapHandler is called
disabled.click() // tapHandler is caller

in v2:

$normal.click() // tap Handler is called
$disabled.click() // tapHandler is *NOT* called

Live Demo

See minimal repro here (modify import to switch between v1/v2):
https://jsbin.com/zusabajelu/1/edit?html,console,output

probably related to #4685 and #5128

@dfreedm
Copy link
Member

dfreedm commented May 2, 2018

Yep, #5128 didn't check that only some elements should respond to disabled attribute. Specifically, <button>, <command>, <fieldset>, <input>, <keygen>, <optgroup>, <option>, <select>, and <textarea>

@dfreedm
Copy link
Member

dfreedm commented May 15, 2018

Fixed by #5230 in 2.x and #5232 in 3.x

@dfreedm dfreedm closed this as completed May 15, 2018
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

2 participants