Skip to content

Commit

Permalink
ignore width if 0
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Jan 19, 2024
1 parent e6b0761 commit 72b4fb9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/TextInput/BaseTextInput/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,9 @@ function BaseTextInput(
styles.visibilityHidden,
]}
onLayout={(e) => {
if (e.nativeEvent.layout.width === 0) {
return;
}
setTextInputWidth(e.nativeEvent.layout.width);
setTextInputHeight(e.nativeEvent.layout.height);
}}
Expand Down
3 changes: 3 additions & 0 deletions src/components/TextInput/BaseTextInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,9 @@ function BaseTextInput(
styles.visibilityHidden,
]}
onLayout={(e) => {
if (e.nativeEvent.layout.width === 0) {
return;
}
let additionalWidth = 0;
if (Browser.isMobileSafari() || Browser.isSafari()) {
additionalWidth = 2;
Expand Down

0 comments on commit 72b4fb9

Please sign in to comment.