This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
Mini Cart and Navigation blocks conflict #4952
Labels
block: mini-cart
Issues related to the Mini-Cart block.
focus: FSE
Work related to prepare WooCommerce for FSE.
type: bug
The issue/PR concerns a confirmed bug.
type: good first issue
The issue is a good candidate for the first community contribution/for a newcomer to the team.
Describe the bug
The Mini Cart and Navigation blocks are using
window.onload
event, first for lazy load scripts, second one for init some MicroModal. So if I use these blocks on same page, only work the second rendered block action. In my case I haveAfter some research.
I replaced
window.onload
towindow.addEventListener('load',function(){})
Using this method ensures that the handler is additive and does not replace existing handlers.
And the 2 blocks works properly.
Screenshots
this and mini cart is not working.
Testing steps
Expected behaviour
The Mini cart block should work.
The text was updated successfully, but these errors were encountered: