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

refactor(ui5-popup): Events do not bubble #1981

Merged
merged 1 commit into from
Jul 27, 2020
Merged

Conversation

vladitasev
Copy link
Contributor

@vladitasev vladitasev commented Jul 23, 2020

Preface: Some events should not bubble, because that leads to strange side effects (f.e. if there are nested popups and the inner one fires an event, the handlers of the outer one will be executed too, unless the user cancels the event or checks the event target).

UI5Element.js now supports non-bubbling events (a new parameter added to fireEvent).

All 4 events of Popup.js were tweaked:

  1. before-open
  • can now be prevented (and prevents any of the code in open from executing)
  • does not bubble
  1. after-open
  • does not bubble
  1. before-close
  • not fired any more if the popup is already open
  • does not bubble
  1. after-close
  • does not bubble

closes: #1962

BREAKING CHANGE: If you relied on before-open, before-close, after-open or after-close bubbling and registered event listeners on a parent element, you must register these event listeners on the popup (popover, dialog etc...) instances directly.

@vladitasev vladitasev merged commit 0ffca82 into master Jul 27, 2020
@vladitasev vladitasev deleted the popup-events-tweaks branch July 27, 2020 05:31
@stevetsanders
Copy link

Hi @vladitasev

Thanks for the quick turn around on this issue. Any idea when it will be released?

@fifoosid
Copy link
Contributor

Hi @stevetsanders

You can expect it released by the end of the week.

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

Successfully merging this pull request may close these issues.

Popover: afterClose event bubbling up to parents?
4 participants