From 9b20a9de4df6b035507b9ffc4b2609c540cd046a Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Wed, 26 Feb 2025 08:34:15 +0700 Subject: [PATCH 1/2] Fix cursor covered --- src/components/TextInput/BaseTextInput/index.native.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/TextInput/BaseTextInput/index.native.tsx b/src/components/TextInput/BaseTextInput/index.native.tsx index 7191369e602a..242d0da826b7 100644 --- a/src/components/TextInput/BaseTextInput/index.native.tsx +++ b/src/components/TextInput/BaseTextInput/index.native.tsx @@ -447,7 +447,8 @@ function BaseTextInput( if (e.nativeEvent.layout.width === 0 && e.nativeEvent.layout.height === 0) { return; } - setTextInputWidth(e.nativeEvent.layout.width); + // Add +2 to width so that cursor is not cut off / covered at the end of text content + setTextInputWidth(e.nativeEvent.layout.width + 2); setTextInputHeight(e.nativeEvent.layout.height); }} > From 327a42c3cada69efee7f29bb40dea25693e94d13 Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Wed, 26 Feb 2025 08:57:01 +0700 Subject: [PATCH 2/2] move the adjustment to correct component --- src/components/TextInput/BaseTextInput/index.native.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/TextInput/BaseTextInput/index.native.tsx b/src/components/TextInput/BaseTextInput/index.native.tsx index 242d0da826b7..d05cbfb278f2 100644 --- a/src/components/TextInput/BaseTextInput/index.native.tsx +++ b/src/components/TextInput/BaseTextInput/index.native.tsx @@ -447,8 +447,7 @@ function BaseTextInput( if (e.nativeEvent.layout.width === 0 && e.nativeEvent.layout.height === 0) { return; } - // Add +2 to width so that cursor is not cut off / covered at the end of text content - setTextInputWidth(e.nativeEvent.layout.width + 2); + setTextInputWidth(e.nativeEvent.layout.width); setTextInputHeight(e.nativeEvent.layout.height); }} > @@ -481,7 +480,8 @@ function BaseTextInput( if (e.nativeEvent.layout.width === 0 && e.nativeEvent.layout.height === 0) { return; } - setTextInputWidth(e.nativeEvent.layout.width); + // Add +2 to width so that cursor is not cut off / covered at the end of text content + setTextInputWidth(e.nativeEvent.layout.width + 2); setTextInputHeight(e.nativeEvent.layout.height); }} >