jupyterlab icon indicating copy to clipboard operation
jupyterlab copied to clipboard

Clicking in the minimap doesn't close the context menu

Open divyansshhh opened this issue 1 year ago • 4 comments

Description

Explained in the GIF below -

22068-48-0_Mini_map_right_click_menu

Reproduce

Open a context menu in the minimap and click on the cells in the minimap

Context

  • JupyterLab version: 4.3.0b3

divyansshhh avatar Oct 10 '24 17:10 divyansshhh

\assign

nakul-py avatar Oct 12 '24 11:10 nakul-py

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 avatar Oct 14 '24 15:10 krassowski

@krassowski Should this be a blocker for 4.3.0, or should it be fixed in 4.3.x or 4.4.0?

JasonWeill avatar Oct 15 '24 16:10 JasonWeill

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

krassowski avatar Oct 15 '24 16:10 krassowski

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!

peytondmurray avatar Dec 23 '24 17:12 peytondmurray

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?

peytondmurray avatar Dec 23 '24 21:12 peytondmurray

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.

krassowski avatar Dec 23 '24 22:12 krassowski