Beste way to listen for modal open #1274
Replies: 3 comments 2 replies
-
@mauritskorse How about something like this? (then you could add a Volt component:
|
Beta Was this translation helpful? Give feedback.
-
@mauritskorse please don't open feature requests for questions. Please open an issue instead. I'm going to close this as it's not a feature request at the moment. |
Beta Was this translation helpful? Give feedback.
-
@jeffchown, thanks. Yes, that would be a solution indeed. However I was looking more for a optimistic ui implementation (prevent the need to make a server round trip). |
Beta Was this translation helpful? Give feedback.
-
What is the best way to listen for a modal being opened?
I have two ways right now, but maybe there is a better / more native approach?
I need to call a script that only can be loaded once the modal is visible.
This is the result of the console log:
After a couple of tries, the onchange event always fires about 15-70 ms later.
Of course it would be great if there is a native oncallbacks we could:
i.e. onBeforeShow, onShow, onBeforeClose, onClose.
Beta Was this translation helpful? Give feedback.
All reactions