Skip to content

fix: focus detached input on iOS (#653)#1231

Merged
dhayab merged 2 commits intoalgolia:nextfrom
salomvary:fix-focus-on-ios
Jan 16, 2024
Merged

fix: focus detached input on iOS (#653)#1231
dhayab merged 2 commits intoalgolia:nextfrom
salomvary:fix-focus-on-ios

Conversation

@salomvary
Copy link
Copy Markdown
Contributor

@salomvary salomvary commented Jan 16, 2024

Originally the focusing code was in a requestAnimationFrame to ensure it wasn't blocking other potentially more important browser work. However, this causes the input not to get focused on iOS, as the focus call isn't related to a user action anymore.

As the requestAnimationFrame doesn't have any real use case, removing it doesn't break any experiences, nor tests.

A test can be written by ensuring the input is immediately focused, not delayed in any way.

fixes #653

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Jan 16, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7baccd2:

Sandbox Source
@algolia/autocomplete-example-github-repositories-custom-plugin Configuration
@algolia/autocomplete-example-instantsearch Configuration
@algolia/autocomplete-example-playground Configuration
@algolia/autocomplete-example-preview-panel-in-modal Configuration
@algolia/autocomplete-example-react-renderer Configuration
@algolia/autocomplete-example-starter-algolia Configuration
@algolia/autocomplete-example-starter Configuration
@algolia/autocomplete-example-reshape Configuration
@algolia/autocomplete-example-vue Configuration
@algolia/autocomplete-example-playground Issue #653

@Haroenv Haroenv requested review from Haroenv and dhayab January 16, 2024 09:11
Copy link
Copy Markdown
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, this PR is good to go for me

Tests, lint, bundlesize passes locally for me

Copy link
Copy Markdown
Contributor

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you!

@dhayab dhayab merged commit 3b569b6 into algolia:next Jan 16, 2024
@dhayab
Copy link
Copy Markdown
Member

dhayab commented Jan 16, 2024

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

input doesn't get focus when entering detached mode

4 participants