Skip to content
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

Focus tracker does not focus on tab item #604

Closed
brichet opened this issue Jun 28, 2023 · 2 comments · Fixed by #606
Closed

Focus tracker does not focus on tab item #604

brichet opened this issue Jun 28, 2023 · 2 comments · Fixed by #606
Labels
bug Something isn't working

Comments

@brichet
Copy link
Contributor

brichet commented Jun 28, 2023

Description

Some context menu in Jupyterlab are not working correctly since #583.

It seems that the focus is not managed the same way when the tabs contain tabindex="0" attribute.

Reproduce

Update lumino to v2023.6.22 and right click on a Notebook tab in dock panel.

EXPECTED ACTUAL

The currentwidget seems to be now the tabbar instead of the tab item, which breaks the behavior of the context menu.

Expected behavior

The focus correctly handling the tab item.

Reference

This bug has been found in jupyterlab/jupyterlab#14610

@brichet brichet added bug Something isn't working status:Needs Triage labels Jun 28, 2023
@welcome
Copy link

welcome bot commented Jun 28, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@brichet brichet changed the title Focus tracker do not focus on tab item Focus tracker does not focus on tab item Jun 28, 2023
@brichet
Copy link
Contributor Author

brichet commented Jul 5, 2023

Some more context after a little introspection:

Adding the tabindex attribute to tabs allows them to get focus (that's the point).
In Jupyterlab, the focusTracker tracks every element added to the shell, including the TabBar.
Since tabs never get focus, the TabBar could not be the current widget of the focusTracker.

Right-clicking on a selected tab should bring up the context menu for the widget displayed (the open document in the case of mainArea). This uses the focusTracker.current widget to choose whether or not to display certain options.
Now that the TabBar can receive focus, it becomes the current widget when a tab is right-clicked, which change the behavior of the context menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants