-
-
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
Activate new current tab #7349
Activate new current tab #7349
Conversation
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
From #6648
Just because that's the way it's done in core currently, I don't think we should necessarily force it on users and extensions. Is there a way to implement @sccolbert's suggestion of (a) checking if we are doing a close event, not just any change event, and (b) checking if the closed tab had focus? |
For example, we could install a child-removed message interceptor somewhere that catches the widget actually removing itself. Or maybe using the activeChanged signal might help, since that also implies something about current focus. |
@jasongrout whenever a tab is closed, it is removed from focustracker and it explicitly sets the active widget to null (https://github.com/phosphorjs/phosphor/blob/master/packages/widgets/src/focustracker.ts#L252). How about if we add a check
implementing @sccolbert's suggestion should be also possible but definitely more complex. |
More than that, it changes the current widget too. The active widget is set to null in other places too, but in those situations, the current widget is kept the same. Yes, I think that logic might work well to identify widgets being removed. Let's try it out. |
I pushed the change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable to me (I tried it locally). Thanks!
fixes #6648
This fixes the issue when current tab and active widget mismatch after closing a tab using keyboard shortcut [Alt W]. It is done by explicitly activating new current tab.