Skip to content

Commit

Permalink
Update useLayout code comment
Browse files Browse the repository at this point in the history
Not to mention WC Navigation, but to preventively filter classes.
  • Loading branch information
tomalec committed Sep 2, 2024
1 parent 42e55b5 commit 8731dee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/src/hooks/useLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export default function useLayout( layoutName ) {

const bodyClassList = document.body.classList;
/**
* For WC Navigation, it already has classes applied, for example, "is-wp-toolbar-disabled".
* Here filter existing classes out to avoid them being removed in the cleanup function.
* Here filter potentially already applied classes out
* to avoid them being removed in the cleanup function.
*/
const classNames = classNameDict[ layoutName ].filter(
( name ) => ! bodyClassList.contains( name )
Expand Down

0 comments on commit 8731dee

Please sign in to comment.