Comments (4)
Hi @maury91, could you provide a jsbin with the issue? the default value of _boundKeyHandlers
is non-null and the behavior never sets it to another value, so maybe your implementor is setting it to null
?
from iron-a11y-keys-behavior.
@valdrinkoshi I've tried to recreate the conditions for the errors, however in this snippet the error doesn't happen.
https://gist.run/?id=6c408a70f06c3ae45102fbe37a55be56
I put in the snippet everything that I think can cause the problem, even using importHref, but without any result.
The version of the components is the same in both the snippet and the real code.
The error happens when the paper-button is moved to another part of the DOM, and the detach event is fired on each behaviour, it's possible that in the snippet the detach event is not fired, or the property is defined.
I put some debug code to show the value of the property for each paper-button and seems undefined, however, is possible that I can't access that property in the way I'm trying.
// I'm accessing the property only for debug, is not part of the real code
The error I get in the real code is:
"TypeError: Cannot read property 'length' of undefined
at HTMLElement._unlistenKeyEventListeners (http://localhost:8080/bower_components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html:448:38)
at HTMLElement.detached (http://localhost:8080/bower_components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html:333:14)
at HTMLElement._invokeBehavior (http://localhost:8080/bower_components/polymer/polymer-micro.html:434:4)
at HTMLElement._doBehavior (http://localhost:8080/bower_components/polymer/polymer-micro.html:427:6)
at http://localhost:8080/bower_components/polymer/polymer-micro.html:218:6
at Object.whenReady (http://localhost:8080/bower_components/polymer/polymer-micro.html:101:1)
at HTMLElement.detachedCallback (http://localhost:8080/bower_components/polymer/polymer-micro.html:216:22)
at DomApi.(anonymous function) [as appendChild] (http://localhost:8080/bower_components/polymer/polymer-mini.html:1236:26)
at http://localhost:8080/app/components/cards/novus-card.html:150:27
at Array.forEach (native)"
from iron-a11y-keys-behavior.
@maury91 looks like you're manually doing redistribution of content in the ready
method of x-card.html
. That causes useless attach/detach/attach for each children of your x-cards.
You should use the select
attribute of <content>
to distribute the content in the correct spots, e.g.
<!-- x-card template -->
<paper-card elevation="0">
<div id="header">
<template is="dom-if" if="[[_headerSpinner(headerSpinner,disableLoadingState)]]">
<paper-spinner id="headerSpinner" active hidden="[[!loading]]"></paper-spinner>
</template>
<h1 hidden=[[!heading]]>
<template is="dom-if" if="[[headerIcon]]">
<iron-icon class="header-icon" icon="[[headerIcon]]"></iron-icon>
</template>
[[heading]]
</h1>
<span class="status" hidden=[[!rightText]]>[[rightText]]</span>
<!-- all headers will go here -->
<content select="header"></content>
</div>
<div>
<!-- the rest of the content gets distributed here -->
<content></content>
</div>
</paper-card>
More info about <content select=
here https://www.polymer-project.org/1.0/docs/devguide/local-dom#dom-distribution
from iron-a11y-keys-behavior.
@valdrinkoshi Thank you very much, it worked, and the error stop happening, I will pay more attention to the polymer functions before implementing my ones
from iron-a11y-keys-behavior.
Related Issues (20)
- Please improve documentation.
- 'esc' not matched for escape key in Chrome Canary, breaking menus HOT 2
- add support for "only" modifier HOT 3
- Autofill causing exceptions HOT 2
- handle keyEventTarget = null
- need to check for null keyEventTarget
- 'KeyboardEvent.keyIdentifier' is deprecated warning in Chrome HOT 6
- demo's tilde key not working on mac french keyboard
- KeyBinding erroneously fired when modifiers are pressed HOT 1
- Numpad "+", "-" and "/" not detected in IE/Edge HOT 1
- this.behaviors property is not available in native 2.0 class-based element HOT 1
- Using iron-a11y-keys-behavior on native elements? HOT 1
- Bug on with Polymer 2 (key events aren't catched) HOT 2
- IronA11yKeysMixin
- iron a11y keys behavior not working polymer 2.x HOT 1
- Can't listen for alt, meta, or shift
- Dynamically add key binding in polymer
- Polymer 3.2: TypeError cannot convert null to object HOT 9
- Uncaught TypeError: Cannot convert undefined or null to object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iron-a11y-keys-behavior.