Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Unexpected callback trigger from paper-toast #132

Open
2 of 8 tasks
hankphung opened this issue Oct 21, 2016 · 3 comments
Open
2 of 8 tasks

Unexpected callback trigger from paper-toast #132

hankphung opened this issue Oct 21, 2016 · 3 comments

Comments

@hankphung
Copy link

hankphung commented Oct 21, 2016

Description

The paper-toast element placed inside paper-dialog trigger on-iron-overlay-closed callback on when dismissed.

Expected outcome

This should not be triggered.

Actual outcome

Dialog on-iron-overlay-closed callback got triggered

Steps to reproduce

  1. Put a paper-toast element inside a paper-dialog.
  2. Add on-iron-overlay-closed callback on paper-dialog with console.log.
  3. Open the paper-dialog.
  4. Trigger the toast to show.
  5. Observe message from console.log.

Browsers Affected

  • Chrome
  • Firefox

//below not tested

  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10
@florent1933
Copy link

florent1933 commented Nov 21, 2016

I think I have a problem related to your issue : #135

@valdrinkoshi
Copy link
Member

These events (iron-overlay-opened, iron-overlay-closed) are bubbling by design, and changing this would be a breaking change.
You can observe the event's root target to see who fired it, e.g.

onOverlayClosed: function(event) {
  var target = Polymer.dom(event).rootTarget;
  if (target.localName === 'paper-dialog') {
    // do things

@florent1933
Copy link

@valdrinkoshi 👍

Thank you so much! This is a good workaround.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants