Simplify some DOM queries

This commit is contained in:
Andrew Kingston 2024-08-09 21:22:48 +01:00
parent 863fafa1d0
commit f87035aa9b
No known key found for this signature in database
1 changed files with 1 additions and 4 deletions

View File

@ -55,10 +55,7 @@ export const isGridEvent = e => {
// Determines whether a DOM element is an immediate child of a grid
export const isGridChild = node => {
return node
?.closest(".component")
?.parentNode.closest(".component")
?.childNodes[0]?.classList?.contains("grid")
return node?.parentNode.classList.contains("grid")
}
// Gets the component ID of the closest parent grid