Skip to content

Commit 2971076

Browse files
authored
fix(autocomplete-core): don't update enterKeyHint on Samsung Browser (#1153)
1 parent c4ba281 commit 2971076

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/autocomplete-core/src/utils/__tests__/isSamsung.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ describe('isSamsung', () => {
7070
)
7171
).toEqual(true);
7272
});
73+
74+
test('returns true with a Samsung Galaxy S9 (mobile) with "Desktop mode" enabled user agent', () => {
75+
expect(
76+
isSamsung(
77+
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/21.0 Chrome/110.0.5481.154 Safari/537.36'
78+
)
79+
).toEqual(true);
80+
});
7381
});
7482
});
7583

packages/autocomplete-core/src/utils/isSamsung.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const regex = /((gt|sm)-|galaxy nexus)|samsung[- ]/i;
1+
const regex = /((gt|sm)-|galaxy nexus)|samsung[- ]|samsungbrowser/i;
22

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

0 commit comments

Comments
 (0)