PolymerElements / paper-button

A button à la Material Design
https://www.webcomponents.org/element/PolymerElements/paper-button
138 stars 64 forks source link

can not click element from "on-transitionend" callback #117

Closed NicolasRannou closed 8 years ago

NicolasRannou commented 8 years ago

Description

Can not click on an element from "on-transitionend" callback.

...
<paper-button raised on-transitionend="clickInput">Load data</paper-button>
<input type="file" id="input" multiple="">
...
clickInput: function(){
  // not working
  this.$.input.click();
}

If I use on-tap instead of on-transtionend the callback works properly.

Expected outcome

Target element should be clicked.

Actual outcome

click() doesn't do anything but this.$.input appear to return a well formatted element.

Live Demo

https://plnkr.co/edit/FvNnn4m1RroAQSoy7eQD?p=preview

Steps to reproduce

  1. Open console
  2. Click on button
  3. Callback is called multiple times but nothing happens
  4. Replace on-transitionend by on-tap on the
  5. It works as expected.

    Browsers Affected

    • [x] All
keanulee commented 8 years ago

You can't trigger file input from non-user interaction. For example, see http://jsbin.com/qusuqunece/edit?html,output

NicolasRannou commented 8 years ago

👍