Skip to content

Allow .focus() to take standard options. (preventScroll, focusVisible) #2491

Open
@Jackman3005

Description

@Jackman3005

Is there an existing request?

  • I have searched for this request

Describe the feature request

Reason for Feature Request

When focusing a text input on Safari, it will automatically scroll to the text input. If there is already an animated scroll in progress, the Safari scroll will interrupt the in-progress scroll and scroll to the text input.

The workaround appears to be to call focus like this: textInput.focus({preventScroll: true}). This however, does not seem to have any effect.

Research

With my limited knowledge, I investigated the focus call through react-native code and it appeared that any arguments provided would not be passed on to the focus event that is emitted.

Expectation

When calling textInput.focus({preventScroll:true}); that the options argument provided to .focus(options) is passed along to the browser for handling as per standard focus specification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequires extension or creation of new React Native APIneeds: issue templateIssue is missing the required issue template fields

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions