Skip to content

Commit cdc8508

Browse files
committed
Check event target element
Signed-off-by: Itay Dafna <[email protected]>
1 parent 29ff164 commit cdc8508

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

js/core/filterMenu.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ export class InteractiveFilterDialog extends BoxPanel {
153153
this._mode === 'condition'
154154
? <Transform.FilterValue>this._filterValue
155155
: this._uniqueValueStateManager.getValues(
156-
this.region,
157-
this._columnIndex,
158-
);
156+
this.region,
157+
this._columnIndex,
158+
);
159159

160160
// Construct transform
161161
const transform: Transform.TransformSpec = {
@@ -461,6 +461,11 @@ export class InteractiveFilterDialog extends BoxPanel {
461461
protected _evtMouseDown(event: MouseEvent) {
462462
// Close the menu if a click is detected anywhere else
463463
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+
}
464469
this.close();
465470
}
466471
}
@@ -590,8 +595,8 @@ export class InteractiveFilterDialog extends BoxPanel {
590595
background: 'var(--ipydatagrid-filter-dlg-bgcolor,white)',
591596
visibility:
592597
this._filterOperator === 'empty' ||
593-
this._filterOperator === 'notempty' ||
594-
this._mode === 'value'
598+
this._filterOperator === 'notempty' ||
599+
this._mode === 'value'
595600
? 'hidden'
596601
: 'visible',
597602
},

0 commit comments

Comments
 (0)