Skip to content

Modal loses focus when focussed element is removed from DOM #486

Open
@OliverJAsh

Description

@OliverJAsh

Summary:

Steps to reproduce:

  1. Focus an element inside the modal (e.g. a link)
  2. Remove it from the DOM (e.g. when the link is clicked, the modal contents re-render to the new route)
  3. Press escape

Expected behavior:

The modal should call onRequestClose, but it doesn't. The active element is the body.

Link to example of issue:

https://jsfiddle.net/ufgse6np/5/embedded/result/

Code: https://jsfiddle.net/ufgse6np/5/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions