-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Initialize toolbar.js once #28838
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
Initialize toolbar.js once #28838
Conversation
Hi @ptylek. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. |
@magento run all tests |
@magento run all tests |
@magento run all tests |
@magento run all tests |
Hi @krzksz, thank you for the review.
|
✔️ QA Passed Manual testing scenario:
Before: ✖️ On click/change link trigger two times After: ✔️ Link triggered once Toolbar functionality is still working as previously (expected). |
Hi @ptylek, thank you for your contribution! |
Description (*)
Continue work that was done by @Nagamaiah007 in #26097.
I changed approach to set events with proper scope of toolbar that javascript is initialized with in order not to process events twice. Previously _bind function was adding events for data-role selectors that were not assigned to this.element scope, so if we had two toolbars on the page (toolbar top and bottom), all events were incorrectly assigned with first toolbar initialization. This change fixes scope for these data-role selectors and won't trigger specific functions to be run twice.
Related Pull Requests
#26097: Update toolbar.js #25934
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)