Skip to content

Commit

Permalink
fix: popover sibling click handler
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Jan 19, 2024
1 parent ec75fc4 commit a96766c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frontend/src/components/Popover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,14 @@ export default {
return
}
const bodyClass = `.${this.popoverContainerClass}`
const clickedElementBody = clickedElement?.closest(bodyClass)
const currentPopoverBody = reference?.closest(bodyClass)
const isSiblingClicked =
clickedElement?.closest(this.popoverContainerClass) ===
reference?.closest(this.popoverContainerClass)
clickedElementBody &&
currentPopoverBody &&
clickedElementBody === currentPopoverBody
if (isSiblingClicked) {
this.close()
}
Expand Down

0 comments on commit a96766c

Please sign in to comment.