ngx-smart-modal
ngx-smart-modal copied to clipboard
Issues with initializing semantic ui elements
I'm submitting a ...
[X ] feature request
Current behavior When rendering a child component inside a modal, the elements are not rendered until the modal is opened. This means that calling the jquery initializer methods for semantic ui do not work in ngoninit etc. Instead you have to find an alternative way to call these after you are sure the modal has been shown the first time, such as :
this.ngxSmartModalService.getModal('xxxxx').open();
if (this.isFirstModalShow) {
this.isFirstMainShow = false;
setTimeout(() => {
this.childComponentInitSemanticUiElements();
});
}
Note: The problem doesn't have anything specific to semantic ui, it's for anything where you want to access the dom elements from jquery.
Expected behavior Just like there are events that fire after the modal has been closed, it would be practical to have events like "onOpened" and "onFinishedRendering" where you know the DOM elements are available.
Hi @archigo and sorry for the late answer.
I understood your issue and yes, we have to implement more events for opening.
Have you tried the existing one (onOpen
)?
Cheers! 🖖
onOpen did not work for me unfortunately.
Sorry for the late answer @archigo. Did you find an alternative since you opened this issue? I was guessing about playing with classes and opacity of the modal or its content to avoid a such glitch... 🤔