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

Trigger Modal using JS #1056

Closed
Aniruddh-J opened this issue Jun 15, 2022 · 4 comments
Closed

Trigger Modal using JS #1056

Aniruddh-J opened this issue Jun 15, 2022 · 4 comments

Comments

@Aniruddh-J
Copy link

Hello,

Thanks for the wonderful library. I was going through the documentation but I couldn't find any way to trigger the modal with JS.

I have a project coming in where the front-end will be in Vue3. Is there any way I can achieve it?

@Aniruddh-J
Copy link
Author

Maybe make a hidden button and trigger a click event on the button?

@ArthurGorbenko
Copy link

+1

@smolenski-mikolaj
Copy link
Contributor

Connected with the global library name issue: #1125
Will be available soon.

@kespaldon
Copy link

kespaldon commented Dec 8, 2022

You can actually do some javascript trikery with this.

const backdrop = document.getElementsByClassName("modal-backdrop")[0];
backdrop.classList.add("show");

const modal = document.getElementById("myModal");
modal.classList.add("show");

worked for me. hope it does for you too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants