[Bug] Modal does not get added to the DOM
See original GitHub issueIm using the Blazored Modal together with Telerik and the Modal dont get displayed.
Does not even appear in the DOM. Im using Blazor Server
To Reproduce I followed the instructions in the readme and I still dont get it running.
Except step 3 everything is the same.
My MainLayout.razor from step 3.
@inherits LayoutComponentBase
<BlazoredModal />
<TelerikRootComponent>
<div style="min-height: 100vh;">
@Body
</div>
</TelerikRootComponent>
This is my Modal: Test.razor
<div>
<p>Please click one of the buttons below to close or cancel the modal.</p>
<button @onclick="Close" class="btn btn-primary">Close</button>
<button @onclick="Cancel" class="btn btn-secondary">Cancel</button>
</div>
@code {
[CascadingParameter] BlazoredModalInstance BlazoredModal { get; set; }
void Close() => BlazoredModal.Close(ModalResult.Ok(true));
void Cancel() => BlazoredModal.Cancel();
protected override void OnInitialized() {
Console.WriteLine("Component started");
base.OnInitialized();
}
}
And thats how I try to open the Modal:
@inject IModalService Modal
// Other code ...
<button @onclick="@(() => Modal.Show<Test>("Test Modal"))" class="btn btn-primary">
Show Test Modal
</button>
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Why can't I access newly added elements (modal popup) in ...
1 Answer. The Salesforce.com Lightning interface is using custom elements and the Shadow Dom to build its UI. To access the invisible elements ......
Read more >Bootstrap Modal Dialog showing under Modal Background
The problem is that the .modal-backdrop overlay sits in the root of the DOM tree while the other content is buried in a...
Read more >JavaScript
Multiple open modals not supported Be sure not to open a modal while another is still visible. Showing more than one modal at...
Read more >Funny Modal hook BUG
This value obviously means that the form component has not been added to the DOM tree at the animation start node, so we...
Read more >Problems with DOM API in LWC lightning-modal
I'm attempting to create a reusable LightningModal component. This modal is invoked from the JavaScript file of the user component using the ...
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
I’m glad the modal is working as it should, sorry to hear you have a bug though. Good luck! 🙂
Sure I’ll, after that i will notify you.