Skip to content

Commit

Permalink
fix(autocomplete-core): don't update enterKeyHint on Samsung Browser (
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienMotte committed Jun 7, 2023
1 parent c4ba281 commit 2971076
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ describe('isSamsung', () => {
)
).toEqual(true);
});

test('returns true with a Samsung Galaxy S9 (mobile) with "Desktop mode" enabled user agent', () => {
expect(
isSamsung(
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/21.0 Chrome/110.0.5481.154 Safari/537.36'
)
).toEqual(true);
});
});
});

Expand Down
2 changes: 1 addition & 1 deletion packages/autocomplete-core/src/utils/isSamsung.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const regex = /((gt|sm)-|galaxy nexus)|samsung[- ]/i;
const regex = /((gt|sm)-|galaxy nexus)|samsung[- ]|samsungbrowser/i;

export function isSamsung(userAgent: string) {
return Boolean(userAgent && userAgent.match(regex));
Expand Down

0 comments on commit 2971076

Please sign in to comment.