Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

addDialogCloseActionListener works only first time #68

Closed
alexberazouski opened this issue May 7, 2018 · 1 comment
Closed

addDialogCloseActionListener works only first time #68

alexberazouski opened this issue May 7, 2018 · 1 comment

Comments

@alexberazouski
Copy link

To reproduce both scenarios I created dialog object on server-side and added closeAction listener.

a) When addDialogCloseActionListener is called, behind the scene the dialog is automatically attached to the page. Which can ruin some toher logic, when it's needed to attach the dialog to specific place.
b) After Dialog was closed first time and reopened $0.$.overlay is already another object, which doesn't listen to the needed events. So, the event is fired only 1 time. Moreover, this can cause mem leaks.

@denis-anisimov
Copy link

Thanks for good analysis and good description.

The addDialogCloseActionListener method implementation is really soooo weird.
You are totally right that there are many issues with it.
The very first thing which makes me confused is the method API.
I've been completely sure that I'm adding only a close listener without any additional action.
In reality one the listener is added the dialog cannot be closed anymore from the client side via clicking outside it or via ESC button. And server side should call close method explicitly to close the dialog.
This is so no obvious that I spent a lot of time trying to understand the behavior.

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

No branches or pull requests

4 participants