-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't do repeated closing of tabs using kb #6648
Comments
If it can help to find cause..., changing the tab when the shortcut does not work anymore makes it work again. |
I am looking into this issue |
See phosphorjs/phosphor#396 (comment) for a suggestion about how to fix this. |
@jasongrout I have been debugging this. I couldn't find a case when a tab is closed while keeping focus somewhere else. For example, if you close the tab using command palette (Close Tab item), palette resets and releases focus to newly activated tab. So, I found it safe to just activate new current tab as a solution. |
From #8575 (comment), here's another writeup of what is going on: The mechanics here are a bit tricky. The close shortcut is registered to be applicable to any element that is itself or a descendant of an element with the
One workaround is to make the My guess is that the same issue happens with the file close and cleanup shortcut. |
Was going to file an issue, but found this. I often need to kill tabs en-masse. Would love to have this. |
Currently looking into this.
@jasongrout would it be reasonable to always focus newly chosen current tab (if there is any)? |
@andrii-i yes I would say so. The change would need to happen there:
|
@fcollonval Thank you. |
First, note that subtleties around Mehmet's attempt at fixing this above, and why the change was reverted and this reopened. As for how the tab bar picks the current tab after a tab is closed, perhaps that happens in Lumino (I haven't traced through the code recently, but I do remember code that does this sort of thing at https://github.com/jupyterlab/lumino/blob/main/packages/widgets/src/tabbar.ts#L1117) |
The logic to pick the new current widget is indeed in Lumino; in Maybe triggering a focus on the new active widget in Lumino is the way forward. But as pointed out by Jason, you must check the behaviour when the tab is closed programmatically - like the launcher case. |
@jasongrout @fcollonval thank you for the pointers. I will keep case of raise condition created when tab is closed programmatically in mind. My logic was that because a) listening to If you have thoughts on how to fix this within jupyterlab (or if I'm missing something in my reasoning), please share and I would love to investigate (e.g. if there is another way to know which tab is current on jupyterlab side outside of listening to |
Open a bunch of tabs in the main work area. Click option+W to close a tab. Repeat. It only works the first time. Something about focus is being lost after the first go, causing the shortcut to stop working.
The text was updated successfully, but these errors were encountered: