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

on-* event delegation (other than on host node) does not work with non-bubbling events #208

Closed
sjmiles opened this issue Jul 15, 2013 · 8 comments
Assignees

Comments

@sjmiles
Copy link
Contributor

sjmiles commented Jul 15, 2013

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.

@peterwmwong
Copy link
Contributor

Here's a test case that could be used (currently failing)... https://github.com/peterwmwong/polymer/commit/988848d8f6bb9797abd56340990b7ec34ab33ac3

@jmesserly
Copy link
Contributor

another non-bubbling event is <video> timeupdate. For example:

<!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)

@sethladd
Copy link

/sub

@ghost ghost assigned sjmiles Sep 25, 2013
@sethladd
Copy link

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!

@jmesserly
Copy link
Contributor

another issue: events from disabled elements bubble on most browsers, so these will fire on Polymer.

(see original dart issue, stackoverflow)

@Krylez-zz
Copy link

+1

@jmesserly
Copy link
Contributor

is this fixed now? in #328

@dfreedm
Copy link
Member

dfreedm commented May 14, 2014

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

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

6 participants