Clicking in the minimap doesn't close the context menu
Description
Explained in the GIF below -
Reproduce
Open a context menu in the minimap and click on the cells in the minimap
Context
- JupyterLab version: 4.3.0b3
\assign
Some pointers:
The pointer down handler for minimap is defined here:
https://github.com/jupyterlab/jupyterlab/blob/c321c27b50431fc0414b20a3b61375af7ccb6c2e/packages/ui-components/src/components/windowedlist.ts#L1523-L1538
and called from here (where the default action and propagation also get cancelled):
https://github.com/jupyterlab/jupyterlab/blob/c321c27b50431fc0414b20a3b61375af7ccb6c2e/packages/ui-components/src/components/windowedlist.ts#L916-L922
On a tangent, we might want to allow click + drag action in the future.
@krassowski Should this be a blocker for 4.3.0, or should it be fixed in 4.3.x or 4.4.0?
I don't think this is a blocker. This issue is not specific to 4.3 either - it exists in 4.2.x too. I just don't think there is much value in backporting a fix to 4.2.x as the virtual scrollbar was less prominent there. If it gets fixed before 4.3.0 is released - great. If not we probably patch it in 4.3.x
Hey all, I'm going to take a look into this, if that's okay with everyone. Thanks @krassowski for the pointers on where to start!
Hmm, after a quick look it seems like letting the event bubble up does the trick, rather than stopping propagation inside the WindowedList event handler. Is there any reason this wouldn't be a viable solution?
I think this would be the right solution. I would double check if user-select: none is set because cancelling the event might have a side effect of preventing text selection within the minimap which I think is desirable.