-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(enterKeyHint): use a fixed enterKeyHint
value on Samsung devices
#916
Conversation
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 ec86a12:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great find—well done!
packages/autocomplete-core/src/utils/__tests__/isChrome.test.ts
Outdated
Show resolved
Hide resolved
packages/autocomplete-core/src/utils/__tests__/isChrome.test.ts
Outdated
Show resolved
Hide resolved
packages/autocomplete-core/src/utils/__tests__/isChrome.test.ts
Outdated
Show resolved
Hide resolved
packages/autocomplete-core/src/utils/__tests__/isChrome.test.ts
Outdated
Show resolved
Hide resolved
packages/autocomplete-core/src/utils/__tests__/isChrome.test.ts
Outdated
Show resolved
Hide resolved
packages/autocomplete-core/src/utils/__tests__/isAndroid.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
@francoischalifour when can I expect this to be merged? |
Hey @nitech, could you try this version on your app and tell us if this effectively fixes the issue for you? You can replace your Autocomplete dependencies with these versions in your
Example: {
// ...
"dependencies": {
"@algolia/autocomplete-js": "https://pkg.csb.dev/algolia/autocomplete/commit/e772e3af/@algolia/autocomplete-js",
"@algolia/autocomplete-theme-classic": "https://pkg.csb.dev/algolia/autocomplete/commit/e772e3af/@algolia/autocomplete-theme-classic"
}
}
|
packages/autocomplete-core/src/utils/__tests__/isAndroid.test.ts
Outdated
Show resolved
Hide resolved
packages/autocomplete-core/src/utils/__tests__/isSamsung.test.ts
Outdated
Show resolved
Hide resolved
packages/autocomplete-core/src/utils/__tests__/isSamsung.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final optimization, and then we'll be good to go!
@sarahdayan bug still present on user agent: Does Algolia Autocomplete allow me to turn off modifying enterKeyHint? |
This PR tries to fix #651.
Issue summary
On a Samsung device using Chrome Android with the Predictive Search feature enabled, the input value is reset when
enterKeyHint
property is updated (between"search"
and"go"
).Result
Based on the current user agent, we detect the device vendor (Samsung), type (mobile or tablet), OS (Android) and browser (Chrome). If all these conditions are matching (
samsung && (mobile || tablet) && android && chrome
), we use a fixed"enter"
value forenterKeyHint
property.