removeModal method doesn't remove ngx-smart-modal element from html dom
See original GitHub issueI’m submitting a …
[x] bug report
[ ] feature request
[ ] support request
Current behavior
I use removeModal
to be able to create new modal with new associated data (from https://github.com/biig-io/ngx-smart-modal/issues/173), but the corresponding ngx-smart-modal element is not removed from html. Is it the normal behavior or a bug?
Everytime I open my modal, I do like this:
this.modalService.removeModal(MY_MODAL);
this.modalService.create(MY_MODAL, MyModalComponent)
.setData(data)
.open();
Expected behavior ngx-smart-modal element should be remove from html dom, but I’d like to hear that if it’s actually a feature or not.
Reproduction of the problem Use the above code to Open modals via class reference without declaring a ngx-smart-modal element in template.
What is the motivation / use case for changing the behavior? Prevent memory leak.
Please tell us about your environment:
- Smart Modal version: 7.4.0
- Angular version: 9
- Browser: Chrome
- Language: TypeScript
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Modal Doesn't Display after removing from DOM
This works fine in removing the modal from the DOM on hide, but after that I can no longer call "show" to display...
Read more >How to create a modal in Javascript | by Marvin Clerge | Medium
We create a div with the class of child and append the given DOM element to it. Then append the child to the...
Read more >HTML DOM Dialog showModal() Method - W3Schools
The showModal() method shows the dialog. When this method is used to show a dialog window, the user is not able to interact...
Read more >Stimulus 101: Building a Modal - Tighten Co.
Stimulus doesn't just allow you to modify the real DOM, ... For instance, an action might be fired when a user clicks on...
Read more >Using React Portals to Render Children Outside the DOM ...
They provide a way to render elements outside the DOM hierarchy so that ... a Portal is to create a new div element...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @maximelafarie. Have you already started to work on this issue? If not, I’d like to look into it. It seems to be a good first issue to start contributing in the project.
Great work @alexsherekin, thank you for refactoring it! I’ll close this issue right after it’s released, I just have few things to fix before pushing a new release! 😉 Cheers! 🖖