Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I call Toggle for a modal? #601

Open
coolblue2000 opened this issue Jul 13, 2023 · 3 comments
Open

How do I call Toggle for a modal? #601

coolblue2000 opened this issue Jul 13, 2023 · 3 comments
Assignees

Comments

@coolblue2000
Copy link

coolblue2000 commented Jul 13, 2023

How do I call toggle on a modal?

For instance I have the following

<BSModal DataId="modal1">
    <MyComponent></MyComponent>
    </BSModal>

@code{
   public async Task Show()
   {
         //toggle modal1
   }
}

I want to do some processing in Show() and set some parameters in MyComponent etc then show the modal. All the examples simply trigger the modal from a button click.

@jbomhold3
Copy link
Collaborator

<BSModal DataId="modal1" @ref="modal">
    <MyComponent></MyComponent>
</BSModal>
@code{
private BSModal modal; 
   public async Task Show()
   {
        modal.ShowAsync();
   }
}

@coolblue2000
Copy link
Author

Thanks that is great!

@SydoxX
Copy link

SydoxX commented Aug 11, 2023

While this is still open; this would be a great example to be added to the docs :)

@jbomhold3 jbomhold3 self-assigned this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants