We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
has anyone tried to implement multiple modals? I am currently trying to, but it shows the same modal even though it has a different value under x-show
any pointers welcome
The text was updated successfully, but these errors were encountered:
Are you sharing the same @click function? I had to create a new function in init-alpine.js in order to make it work with multiple modals.
// Default Modal isModalOpen: false, trapCleanup: null, openModal() { this.isModalOpen = true this.trapCleanup = focusTrap(document.querySelector('#modal')) }, closeModal() { this.isModalOpen = false this.trapCleanup() }, // my added modal isConfirmDeleteModalOpen: false, openConfirmDeleteModal(e) { this.isConfirmDeleteModalOpen = true this.trapCleanup = focusTrap(document.querySelector('#confirm-delete-modal')) document.querySelector('#confirm-delete-button').setAttribute( 'data-event-uuid', e.target.getAttribute('data-event-uuid') ) document.querySelector('#confirm-delete-for-title').textContent = ( e.target.getAttribute('data-event-title') ) }, closeConfirmDeleteModal() { this.isConfirmDeleteModalOpen = false this.trapCleanup() document.querySelector('#confirm-delete-button').setAttribute( 'data-event-uuid', '' ) },
Sorry, something went wrong.
No branches or pull requests
has anyone tried to implement multiple modals? I am currently trying to, but it shows the same modal even though it has a different value under x-show
any pointers welcome
The text was updated successfully, but these errors were encountered: