Skip to content

Fix FocusManager failing to deal with dead nodes #8957

@BenHenning

Description

@BenHenning

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

#8941 discovered a class of problems that weren't previously considered in the implementation and testing of FocusManager: the event that a node becomes orphaned without an accompanying focus event.

This isn't an easy situation to produce as most cases when an element is deleted a focus event should trigger to ensure the manager cleans up its internal state. However, it seems that there may sometimes be cases where a passive node can still be found in the DOM but it's no longer part of its parent tree. When trying to restore access to this node, an exception would be thrown. Note that this is one of multiple theoretical cases that may need to be explored.

#8941 (review) is another part to look into to see if this is a case that actually produces problems.

Reproduction steps

These are theoretical bugs at this point, so there are not yet known repro steps. It will likely be easier to try and repro these conditions in a test rather than directly, but so far my testing hasn't found problems with deleted nodes.

Stack trace

Screenshots

No response

Browsers

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugDescribes why the code or behaviour is wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions