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] Modal does not get added to the DOM

See original GitHub issue

Im 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chrissaintycommented, Mar 17, 2020

I’m glad the modal is working as it should, sorry to hear you have a bug though. Good luck! 🙂

1reaction
NBprojektcommented, Mar 17, 2020

Sure I’ll, after that i will notify you.

Read more comments on GitHub >

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

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