jupyter-widgets / ipydatagrid

Fast Datagrid widget for the Jupyter Notebook and JupyterLab
BSD 3-Clause "New" or "Revised" License
579 stars 51 forks source link

Filter by condition type menu disappears on click #256

Closed mangecoeur closed 2 years ago

mangecoeur commented 3 years ago

I have a datagrid in a Tab widget. When i click Filter -> Filter by condition and I try to select a condition type (less than, greater than, in between) with the mouse, the whole menu disappears on click (so I can't enter the values). If I use the arrow keys or the mouse to highlight the desired condition and press enter, it works fine - it seems that the mouse click event is causing the whole menu to be hidden.

Using Firefox 90.0.0.2 on macOS 11.4, Jupyterlab 3.1.2

mangecoeur commented 3 years ago

P.S. I think this issue is linked to these lines in core/filterMenu.ts

protected _evtMouseDown(event: MouseEvent) {
    // Close the menu if a click is detected anywhere else
    if (!ElementExt.hitTest(this.node, event.clientX, event.clientY)) {
      this.close();
    }
  }

The menu that appears for the 'select' looks like a native menu rather than one drawn by widget system (has different styling than the ipywidgets dropdown select). So I suspect that when I click on it, the click is doesn't register as being in the 'hitbox' (either because it's x,y is outside the region or is null or something) and this closes the menu.

mangecoeur commented 3 years ago

P.P.S This seems to be specific to Firefox, using a Chromium-based browser (Brave in this case) doesn't have the issue. On the other hand, in Safari datagrid doesn't work at all with the error Unhandled Promise Rejection: Error: Module ipydatagrid, semver range ^1.1.1 is not registered as a widget module 272.2a8425db7209008188fc.js:1:2113

ibdafna commented 3 years ago

@mangecoeur Many thanks for filing this issue! I am able to reproduce this on Firefox (Chrome works fine, as you noted). Will investigate.

ibdafna commented 2 years ago

grid_firefox

Taking a look