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.

[Bug] Cancel Modal created in component in parent

See original GitHub issue

I recently upgraded BlazoredModal from 3.0 to 4.1.

I have three razor pages: Search, ImageStack, ImagePopup.

Search has a top search bar that is above all layers. The body reports results of the search.

Search utilizes component ImageStack in the results.

ImageStack helps me manage some html regarding the images returned in a search. It is also the component that opens the BlazoredModal with Modal.Show<ImagePopup>(null, parameters, options);

In version 3, I could close the modal from search with Modal.Cancel(); if i had @inject IModalService Modal; up top.

I am guessing with the implementation of instances Modal.Cancel() on the IModalService no longer exits. However, I cannot find a method to capture all modal instances to close/cancel them all.

To summarize, I want to be able to close all modals when I perform another search or return home. As it is, the modal will continue to stay up with all results appearing in the layers under it.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
larsk2009commented, Apr 29, 2020

Hi @joehatescoffee

Please have a look at this and/or this. That shows execatly what you are trying to do I think.

If that doesn’t help, let me know!

0reactions
chrissaintycommented, May 8, 2020

This sounds like a design problem and not so much an issue with the model. I don’t think there is any work for us to do here so I’m going to close this issue.

If you need help with your design please ask here and we will help as much as we can.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React: Closing Modal in Child Component from Parent
I have a modal in a child component that handles a delete function in the parent component. The child is holding the state...
Read more >
Can't save record of child component is nested in parent ...
In this case, component A will call component B to open a new modal popup. The problem occurs when I press the save...
Read more >
Best method to toggle modal component. Opening with ...
I want a parent to trigger a child component to open a modal and have the component close itself. I first tried setting...
Read more >
Lightning overlayLibrary function reference won't close modal
So it seems the simply calling the notifyClose() function from the component that created the modal doesn't work because the required event it ......
Read more >
Modal | Components
Overview. <b-modal> , by default, has an OK and Cancel buttons in the footer. These buttons can be customized by setting various props...
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