Skip to content

Fix loading of modal text when removing collection item#3267

Merged
bobdenotter merged 2 commits intomasterfrom
fix/remove-collection-item-modal
Jul 5, 2022
Merged

Fix loading of modal text when removing collection item#3267
bobdenotter merged 2 commits intomasterfrom
fix/remove-collection-item-modal

Conversation

@nestordedios
Copy link
Copy Markdown
Collaborator

@nestordedios nestordedios commented Jul 1, 2022

Fixes #3266

Using event.currentTarget instead of event.target we can target the button element to get the data-attribute values needed to populate the content of the modal even if the user click on the icon or text of the button.

Using event delegation like window.$(document).on('click', '[data-bs-toggle="modal"]', function(event) is what we need to make sure new added collection item remove buttons trigger the load of the modal text.

Copy link
Copy Markdown
Member

@bobdenotter bobdenotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍

@bobdenotter bobdenotter merged commit 01876f5 into master Jul 5, 2022
@bobdenotter bobdenotter deleted the fix/remove-collection-item-modal branch July 5, 2022 10:00
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

Successfully merging this pull request may close these issues.

Modal does not load when removing a new collection item

2 participants