Skip to content

bug: overlay element shouldn't be focused upon presenting when descendant already focused #24127

@MarkChrisLevy

Description

@MarkChrisLevy

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

When overlay is set to be closed by Escape key, overlay element is always focused in present() method, even if its descendant is already focused.

Expected Behavior

When overlay's descendant is already focused do not call focus on overlay's element.

Steps to Reproduce

  1. Create a component, that will be opened within modal
  2. Create render() and add ion-input
  3. Add componentDidLoad or listener for ionViewDidEnter and focus ion-input

Input will be focused for a moment, but will be blured just after that as the focus is shifted to overlay's element.

Code Reproduction URL

No response

Ionic Info

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions