Skip to content

List does not show which element is focused when custom context menu is shown #123771

Closed

Description

@gtteamamxx

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:

image

image

image

Activity

  1. isidorn commented on May 14, 2021

    @isidorn

    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)

  2. 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
  3. joaomoreno commented on May 16, 2021

    @joaomoreno
    Contributor

    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.

  4. added
    feature-request
    list-widget
    on May 16, 2021
  5. gtteamamxx commented on May 16, 2021

    @gtteamamxx
    Author

    I'm glad that something will change with this :)

  6. isidorn commented on May 25, 2021

    @isidorn

    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?

  7. joaomoreno commented on May 26, 2021

    @joaomoreno
    Contributor

    Isidor Nikolic (@isidorn) This is tough to fix.

  8. sbatten commented on May 26, 2021

    @sbatten
    Member

    João Moreno (@joaomoreno) can you leverage

    domForShadowRoot?: HTMLElement;
    ?

  9. joaomoreno commented on May 27, 2021

    @joaomoreno
    Contributor

    SteVen Batten (@sbatten) What do you mean?

    This is hard to fix because:

    • 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.
  10. sbatten commented on May 27, 2021

    @sbatten
    Member

    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.

  11. gtteamamxx commented on Jun 11, 2021

    @gtteamamxx
    Author
  12. added
    bug
    and removed
    feature-request
    on Nov 8, 2021
  13. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Nov 8, 2021
  14. added
    verified
    on Dec 2, 2021
  15. roblourens commented on Dec 2, 2021

    @roblourens
    Member

    I did notice that the highlight will stick around after I dismiss the context menu

    Dec-01-2021 16-15-20

  16. joaomoreno commented on Dec 2, 2021

    @joaomoreno
    Contributor

    Yeah because the list is still focused at that time: press UpArrow to confirm.

  17. locked and limited conversation to collaborators on Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

buginsiders-releasedlist-widgetverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions