Skip to content

focus delegate code seems wrongly only looking at children #8157

Closed

Description

@emilio

(Again, unless I'm missing something)

https://html.spec.whatwg.org/#focus-delegate says:

For each child of parent's children:

  1. Let focusable area be child, if child is a focusable area; otherwise let focusable area be the result of getting the focusable area for child given focus trigger.

It only looks at children, but it seems to (in a note) think that "getting the focusable area" can end up recursing. Which is true, but afaict it only does if the child has delegateFocus, which seems wrong (see #8156).

So I think this should look at all descendants in tree order, which combined with the fix for #8156 would give you the behavior we generally want / expect.

cc @sefeng211 @domenic

Activity

  1. added
    topic: focus
    agenda+
    on Aug 4, 2022
  2. sefeng211 commented on Aug 4, 2022

    @sefeng211
    Contributor

    So should we look for shadow root with delegateFocus and also non shadow host here?

  3. emilio commented on Aug 5, 2022

    @emilio
    ContributorAuthor

    Where exactly? "Get a focusable area" already deals with delegatesFocus so I think we don't need to do it twice.

  4. added a commit that references this issue on Aug 9, 2022
    a93d242
  5. removed
    agenda+
    on Aug 18, 2022
  6. added a commit that references this issue on Feb 2, 2024
    4d6609f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: focus

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions