This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
WC navigation handler clears current
class from every element on entire page.
#7772
Labels
Describe the bug
In Google Listings & Ads plugin, we use some sub-navigation in a number of places and use
NavigableMenu
,Link
elements, andcurrent
CSS class for consistency with the rest of WC UI.It occurred that sometimes the "current"/"active" state of an element was cleared in what seemed to be unrelated navigation events.
It occurred that
wpNavMenuClassChange
function, used (as the name suggests) to change class on WP navigation menu, changes thecurrent
class one every element on the page. Including our components and sub-navigation.To Reproduce
current
class.window.wpNavMenuClassChange( {wpOpenMenu: 'toplevel_page_woocommerce-marketing'}, window.location.href )
Actual behavior:
The
current
class is removed from our element.Screenshots
Expected behavior
Elements outside the WP menu should not be affected by
wpNavMenuClassChange
and WC-admin navigation.Desktop (please complete the following information):
Additional context
wpNavMenuClassChange
is not scoped to the menu.woocommerce-admin/client/layout/controller.js
Line 303 in 689b0ea
The text was updated successfully, but these errors were encountered: