PolymerElements / iron-a11y-keys-behavior

A behavior that enables keybindings for greater a11y
24 stars 41 forks source link

Setting keyEventTarget on element prototype is overwritten. #19

Closed ebidel closed 8 years ago

ebidel commented 9 years ago

For an element that uses this behavior, setting keyEventTarget on the element's prototype gets overwritten by the behavior to this (the element).

keyEventTarget: document.body

My workaround was to set this in ready:

ready: function() {
  this.keyEventTarget = document.body;
}
cdata commented 8 years ago

keyEventTarget is a Polymer property and should be overridden in the properties block, e.g.

properties: {
  keyEventTarget: {
    type: Object,
    value: function() {
      return document.body;
    }
  }
}

If I am mis-understanding the issue being reported, please feel free to re-open!