Skip to content

Commit ca4fae7

Browse files
committed
Check if target is a child of parent node
Signed-off-by: Itay Dafna <[email protected]>
1 parent cdc8508 commit ca4fae7

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

js/core/filterMenu.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -460,12 +460,10 @@ export class InteractiveFilterDialog extends BoxPanel {
460460
*/
461461
protected _evtMouseDown(event: MouseEvent) {
462462
// Close the menu if a click is detected anywhere else
463-
if (!ElementExt.hitTest(this.node, event.clientX, event.clientY)) {
464-
// FireFox will register a click event for an ephemeral Option element,
465-
// and the hitTest will have x,y coordinates of (0,0).
466-
if ((event.target as HTMLElement).tagName === 'OPTION') {
467-
return;
468-
}
463+
if (
464+
!ElementExt.hitTest(this.node, event.clientX, event.clientY) &&
465+
!this.node.contains(event.target as HTMLElement)
466+
) {
469467
this.close();
470468
}
471469
}

0 commit comments

Comments
 (0)