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

[polymer] event.stopPropagation() has no effect (for on-click) #14169

Closed
DartBot opened this issue Oct 17, 2013 · 14 comments
Closed

[polymer] event.stopPropagation() has no effect (for on-click) #14169

DartBot opened this issue Oct 17, 2013 · 14 comments
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams.
Milestone

Comments

@DartBot
Copy link

DartBot commented Oct 17, 2013

This issue was originally filed by @hpoul


i have two nested <div> elements with on-click handlers. calling event.stopPropagation() in the inner element's click handler seems to have no effect. I think this should prevent the outer event handler from beeing called?

What steps will reproduce the problem?

simple polymer web component, html:
    <polymer-element name="stop-propagation">
      <template>
        <div on-click="outerClicked">
          Outer.
          <div on-click="innerClicked">
            Inner.
          </div>
        </div>
      </template>
      
      <script type="application/dart" src="stoppropagation.dart"></script>
    </polymer-element>

dart code:
  void innerClicked(Event event, var detail, Node target) {
    event.stopPropagation();
    print('inner clicked');
  }
  void outerClicked(Event event, var detail, Node target) {
    print('outer clicked');
  }

What is the expected output? What do you see instead?

i think wenn clicking on 'inner' only 'inner clicked' should be shown, but also 'outer clicked' is called.

What version of the product are you using?
Dart Editor version 0.8.1_r28355
testing in dartium coming with dart editor (31.0.1612.0 (219647))

Please provide any additional information below.
since i stumbled upon the problem when porting my web-ui app, it's probably a problem in polymer, not dart.. couldn't find any open issues in polymer.js issue tracker though.

my two files i've used for testing: https://github.com/hpoul/dart-polymer-dart-examples/tree/b9f9ac052b15ea97250daad97a1a45c2124ef251/web/stoppropagationtest

@madsager
Copy link
Contributor

Added Area-Polymer, Triaged labels.

@jmesserly
Copy link

This is probably caused by the fact that we can't check "cancelBubble" in Polymer.dart because it's deprecated. So I had to change the code. I'll see if I can workaround that...


cc @blois.
Added this to the M8 milestone.
Added Library-Polymer label.

@blois
Copy link
Contributor

blois commented Oct 18, 2013

I don't think that cancelBubble even reflects this- playing with it quickly stopPropagation does not impact cancelBubble.

@jmesserly
Copy link

hmmm. I wonder if it reproduces in polymer.js... might be a dupe of Polymer/polymer#208

@DartBot
Copy link
Author

DartBot commented Oct 18, 2013

This comment was originally written by @hpoul


i'm not sure if polymer 208 is related, but from my perspective it's kind of the opposite :-) but i've ran into both.. 208 is being unable to listen to blur/focus events because they don't propagate, which is a requirement it seems for on-* to work, while click events do propagate, but i was unable to prevent propagation.. so might be related, but the issues i found in the polymer.js issue tracker related to bubbling suggest that stopPropagation works there, but have only used polymer.dart yet :-) thx

@jmesserly
Copy link

Removed this from the M8 milestone.
Added this to the Later milestone.

@sigmundch
Copy link
Member

Removed this from the Later milestone.
Added this to the M9 milestone.

@clayberg
Copy link

Removed this from the M9 milestone.
Added this to the 1.1 milestone.

@sigmundch
Copy link
Member

Removed this from the 1.1 milestone.
Added this to the 1.2 milestone.

@jmesserly
Copy link

Removed Area-Polymer label.
Added area-pkg, Pkg-Polymer labels.

@jmesserly
Copy link

Removed Library-Polymer label.

@kasperl
Copy link

kasperl commented Jun 4, 2014

Removed this from the 1.2 milestone.
Added this to the 1.6 milestone.

@sigmundch
Copy link
Member

I just adapted the example to work with the latest polymer (0.11) and it seems to be working great. The stopPropagation succesfully stops the event from firing on the outer element.


Added Fixed label.

@DartBot DartBot added Type-Defect area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. labels Jun 30, 2014
@DartBot DartBot added this to the 1.6 milestone Jun 30, 2014
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-archive/polymer-dart#88.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams.
Projects
None yet
Development

No branches or pull requests

8 participants