question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

removeModal method doesn't remove ngx-smart-modal element from html dom

See original GitHub issue

I’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:open
  • Created 3 years ago
  • Reactions:6
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
alexsherekincommented, Oct 18, 2020

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.

1reaction
maximelafariecommented, Oct 14, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found