Skip to content

bug: searchInput.setFocus() does not work on IOS #25271

@agustindiazg

Description

@agustindiazg

Prerequisites

Ionic Framework Version

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

Current Behavior

When i open a modal with a search input on desktop focus function does work, when doing the same in Safari/Chrome in IOS ir does not

Expected Behavior

When i open a modal with a search input on desktop/IOS the search input is on focus

Steps to Reproduce

I have an ionic app using Vue3 and i have this watchEffect, so after the state of the modal is change, it does run.
This does set the focus on Desktop not in Safari (IOS)

    watchEffect(() => {
      const searchInputElem = searchInput.value?.$el;
      nextTick(() => {
        setTimeout(() => {
          searchInputElem && searchInputElem.setFocus();
        }, 750);
      });
    });

Code Reproduction URL

No response

Ionic Info

"@ionic/vue": "5.9.3",
"@ionic/vue-router": "5.9.3",

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