ngx-smart-modal icon indicating copy to clipboard operation
ngx-smart-modal copied to clipboard

Issues with initializing semantic ui elements

Open archigo opened this issue 5 years ago • 3 comments

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.

archigo avatar Mar 14 '19 11:03 archigo

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! 🖖

maximelafarie avatar Mar 28 '19 10:03 maximelafarie

onOpen did not work for me unfortunately.

archigo avatar Apr 02 '19 06:04 archigo

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... 🤔

maximelafarie avatar Dec 06 '19 09:12 maximelafarie