vendredi 3 décembre 2021

Emberjs : Open modal from otther modal only when the first has left the DOM

I use Emberjs 3.19.0 (actually I can't change the version) whith "ember-modal-dialog": "^3.0.0-beta.4".

In my index.hbs I have 2 buttons which allow me to open 2 different modals. These modals have different models but both have a captcha generated on the fly, I want to be able to initiate the opening of a modal from another modal. I am having an issue with the source modal lifecycle that causes the target modal's captcha to not load. I think the captcha is still part of the dom on the first modal.

Currently I am transmitting a function of the index.js to the first modal but I had to put a await new Promise(resolve => setTimeout(resolve, 400)); that allows me to wait until the first modal is completely outside the dom before opening the second. This solution is not clean, I ask you if you have another idea?




Aucun commentaire:

Enregistrer un commentaire