-
Notifications
You must be signed in to change notification settings - Fork 2k
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
on-* event delegation (other than on host node) does not work with non-bubbling events #208
Comments
Here's a test case that could be used (currently failing)... https://github.com/peterwmwong/polymer/commit/988848d8f6bb9797abd56340990b7ec34ab33ac3 |
another non-bubbling event is <!DOCTYPE html>
<html>
<head>
<title>index</title>
<script src="polymer.min.js"></script>
</head>
<body>
<polymer-element name="my-element">
<template>
<video id="vidya" width="768" height="432" controls
src="http://html5demos.com/assets/dizzy.webm"
on-timeupdate="timeupdate">
</template>
<script>
Polymer('my-element', {
timeupdate: function(event) {
console.log("Time update function ");
},
});
</script>
</polymer-element>
<my-element></my-element>
</body>
</html> (originally reported at https://code.google.com/p/dart/issues/detail?id=12604) |
/sub |
Hi, Any updates or progress on this issue? We had a Dart user ask about blur and focus. I pointed them to this bug. Thanks for any thoughts! |
another issue: events from disabled elements bubble on most browsers, so these will fire on Polymer. (see original dart issue, stackoverflow) |
+1 |
is this fixed now? in #328 |
Yep, this has been working for a while. Integrated @peterwmwong's example and a few other non-bubbling events into a horrible mess: http://jsbin.com/luyejuye/1/edit |
The event delegation mechanism relies on bubbling to capture
on-
events at subtree roots. This mechanism does not work for non-bubbling events like 'focus' and 'blur'.As workarounds one could attach listeners directly to the nodes in question, or construct a custom element extension for the node that bubbles a custom version of the needed event.
The text was updated successfully, but these errors were encountered: