You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
List does not show which element is focused when custom context menu is shown #123771
bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code Insiderslist-widgetList widget issuesverifiedVerification succeeded
I can imagine situations where someone missed right-click and deleted other file than wanted to.
To avoid this situation we can set border. Like when file is focused:
Yes, this is the problem with List / Tree in general with the Custom menu and I can reproduce. Thus forwarding to João Moreno (@joaomoreno)
It seems like the focus border is only rendered when the focus is on the list, and the native context menu "steal focus"
changed the title [-]Right-Click on solution explorer item should set border to clicked item[/-][+]List does not show which element is focused when custom context menu is shown[/+]on May 14, 2021
I have always argued for this and somehow got lost over time. I even went to great lengths to make this work in dropdown menus. Unfortunately, the list/tree doesn't know about context menus. It seems like maybe it should.
This is present for all our Web experiences and Windows and I think we should fix sooner or later. João Moreno (@joaomoreno) Should we maybe open this up for PRs if you can provide a code pointer?
List focus indicators are supposed to be invisible when the list (or the app) doesn't have focus
When a context menu comes up, it takes focus by definition, so the list focus affordance gets hidden
For this to work, the list would need to be aware that there's a context menu open related to itself. But the list doesn't know anything about context menus: they are a construct of the list's users.
I don't know how the context menus are created but if whoever creates the context menu knows the selected list item at the time, it could be used as the parent of the context menu in a shadow dom to preserve focus. this is how dropdowns work in view actions where they disappear on focus lost.
bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code Insiderslist-widgetList widget issuesverifiedVerification succeeded
Activity
isidorn commentedon May 14, 2021
Yes, this is the problem with List / Tree in general with the Custom menu and I can reproduce. Thus forwarding to João Moreno (@joaomoreno)
It seems like the focus border is only rendered when the focus is on the list, and the native context menu "steal focus"
This works nicely on macOS with native menus.
fyi SteVen Batten (@sbatten)
[-]Right-Click on solution explorer item should set border to clicked item[/-][+]List does not show which element is focused when custom context menu is shown[/+]joaomoreno commentedon May 16, 2021
I have always argued for this and somehow got lost over time. I even went to great lengths to make this work in dropdown menus. Unfortunately, the list/tree doesn't know about context menus. It seems like maybe it should.
gtteamamxx commentedon May 16, 2021
I'm glad that something will change with this :)
isidorn commentedon May 25, 2021
This is present for all our Web experiences and Windows and I think we should fix sooner or later.
João Moreno (@joaomoreno) Should we maybe open this up for PRs if you can provide a code pointer?
joaomoreno commentedon May 26, 2021
Isidor Nikolic (@isidorn) This is tough to fix.
sbatten commentedon May 26, 2021
João Moreno (@joaomoreno) can you leverage
vscode/src/vs/base/browser/contextmenu.ts
Line 31 in 7031aba
joaomoreno commentedon May 27, 2021
SteVen Batten (@sbatten) What do you mean?
This is hard to fix because:
sbatten commentedon May 27, 2021
I don't know how the context menus are created but if whoever creates the context menu knows the selected list item at the time, it could be used as the parent of the context menu in a shadow dom to preserve focus. this is how dropdowns work in view actions where they disappear on focus lost.
gtteamamxx commentedon Jun 11, 2021
João Moreno (@joaomoreno) any updates?
roblourens commentedon Dec 2, 2021
I did notice that the highlight will stick around after I dismiss the context menu
joaomoreno commentedon Dec 2, 2021
Yeah because the list is still focused at that time: press UpArrow to confirm.