Skip to content

Commit a5cf540

Browse files
committed
Fix newLeftOffset on Android
1 parent 6734cbc commit a5cf540

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/components/AutoCompleteSuggestions/getSuggestionsLeftOffset.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ function getLeftOffset(
1010
isInLandscapeMode: boolean,
1111
): number {
1212
if (isInLandscapeMode) {
13-
// Some Android devices have issue where they add insets.left to x value, so we need to subtract it to get the correct left offset.
14-
if (x + insets.left + insets.right + menuWidth > windowWidth) {
13+
// On Android devices, sometimes x takes into consideration the insets.left value, sometimes not
14+
// so in case it does we want to subtract it to get the correct left offset.
15+
if (x - insets.left >= 0) {
1516
return x - insets.left;
1617
}
1718

0 commit comments

Comments
 (0)