-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Comments
Added Area-Polymer, Triaged labels. |
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. |
I don't think that cancelBubble even reflects this- playing with it quickly stopPropagation does not impact cancelBubble. |
hmmm. I wonder if it reproduces in polymer.js... might be a dupe of Polymer/polymer#208 |
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 |
Removed Area-Polymer label. |
Removed Library-Polymer label. |
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. |
This issue has been moved to dart-archive/polymer-dart#88. |
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
The text was updated successfully, but these errors were encountered: