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

Event on-keys-pressed fired twice on Firefox #41

Closed
1 of 8 tasks
rmdwirizki opened this issue Aug 23, 2017 · 2 comments
Closed
1 of 8 tasks

Event on-keys-pressed fired twice on Firefox #41

rmdwirizki opened this issue Aug 23, 2017 · 2 comments

Comments

@rmdwirizki
Copy link

Description

The on-keys-pressed event handler fired twice on firefox. But worked fine in Chrome. I have this code :

<dom-module id="my-app">
    <template>
        <iron-a11y-keys target="[[target]]" keys="space" on-keys-pressed="spacing"></iron-a11y-keys>
        <input type="text" autofocus="autofocus">
    </template>
</dom-module>
<script>
...
static get properties() {
    target: Object
}
ready() {
    super.ready()
    this.target = this.shadowRoot.querySelector('input')
}
//This is the event handler
spacing(e) {
    alert('You pressed the ' + e.detail.key + ' key')
}
...
</script>

Expected outcome

When pressing the 'space' key on input element, the alert dialog showed up once

Actual outcome

When pressing the 'space' key on input element, the alert dialog showed up twice instead

Live Demo

https://jsbin.com/jelayoq/2/edit?html,output

Steps to reproduce

  1. Use webcomponents-lite.js > v1.0.0-rc.6. (It starting to fired twice on version above the v1.0.0-rc.6)
  2. Import iron-a11y-keys and use it to bind to input.
  3. Attach an event handler with on-keys-pressed to the input.
  4. Try it on firefox.
  5. Or just open the live demo in firefox browser.

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10

I'm using firefox 55.02

@mgibas
Copy link

mgibas commented Oct 26, 2017

Same for IE11

@valdrinkoshi
Copy link
Member

This is a bug on shadydom with removing an event listener on shadow roots, filed an issue here webcomponents/shadydom#190
Closing this in favor of webcomponents/shadydom#190

greenyouse pushed a commit to greenyouse/paper-date-range that referenced this issue May 2, 2018
iron-a11y-keys is double firing events on Firefox 55+. Just a
temporary fix until it's resolved upstream.

PolymerElements/iron-a11y-keys#41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants