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
Modal not working with Angular #830
Comments
My issue is the same, but I am using Flask. |
My solution is to ensure that the entire page is loaded before getting the modal instance: window.addEventListener('load', () => {
const modal = FlowbiteInstances.getInstance('Modal', 'modal-id')
modal.show()
}) It works fine. |
ok thanks but "FlowbiteInstances" give me an error: Cannot find name FlowbiteInstances. how did you import it? |
In my case,
the docs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Hi, i'm using Flowbite with Angular. I have an error with the modals: Flowbite: Instance with ID offer does not exist. Modal with id offer has not been initialized. Please initialize it using the data-modal-target attribute. But I have already entered the data-modal-target attribute on my button.
this is the button code:
<button data-modal-target="card_modal" data-modal-toggle="card_modal" class="text-white bg-[#7E2BB5] font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"> Change </button>
and this is the modal
<div id="card_modal" data-modal-backdrop="static" tabindex="-1" aria-hidden="true" class="hidden fixed top-0 left-0 right-0 z-50 w-full p-8 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
And the errors in the console is this:
The text was updated successfully, but these errors were encountered: