Text Input - Cursor/Selection Position

:warning: Before you continue


Before submitting a bug report, please review our troubleshooting documentation at Troubleshoot Issues | Vega Troubleshooting

If you still want to file a bug report, please make sure to fill in all the details below and provide the necessary information.

NOTE: PLEASE ONLY REPORT A SINGLE BUG USING THIS TEMPLATE.
If you’re experiencing multiple issues, please file a separate report for each.


:backhand_index_pointing_right: Bug Description


1. Summary

When the user has a text input on the left and an interactive element (Eg. button) on the right, the cursor position selection on the text input when returning the focus from the right element will shift one to the left instead of remaining at the end.

Eg. “InputText|” → focus on right element → focus back to text input→ “InputTex|t” → focus on right element → focus back to text input → “InputTe|xt”

The prop for selection could be a potential workaround but another issue occurs if the user opens up the virtual keyboard and starts adding inputs. It’ll stay at the set position (eg. position 3 instead of updating to 4, 5… and so on). It’ll just keep adding text from that position instead of appending it to the end. We can’t also unset this selection prop by assigning it undefined.

App Name: Paramount+
App Link on Amazon Appstore (found through Developer Console → Actions column in App List → View on Amazon.com): Paramount+ - App on Amazon Appstore

Bug Severity
Select one that applies

  • Impacts operation of app
  • Blocks current development
  • Improvement suggestion
  • Issue with documentation (If selected, please share the doc link and describe the issue)
  • Other

2. Steps to Reproduce

  1. Have a TextInput component on the left side and a Button component on the right side
  2. Add text to the TextInput so that the cursor position is at the end
  3. Focus on the right button
  4. Focus back on the TextInput by pressing left
  5. Repeat a few times

3. Observed Behavior

Explain what actually happened, noting any discrepancies or malfunctions.

The cursor/selection shifts one left each time it returns from the right element.

4. Expected Behavior

Describe what you expected the SDK to do under normal operation.

The cursor/selection should remain at the end (or the previous position when it was unfocused) when being focused from another element.

4.a Possible Root Cause & Temporary Workaround

Fill out anything you have tried. If you don’t know, N/A is acceptable

Tried using the `selection` property to set the start & end. But this position cannot be unset.

5. Logs or crash report

(Please make sure to provide relevant logs as attachment)

N/A

6. Environment

Please fill out the fields related to your bug below:

  • SDK Version: v0.22

  • App State: Foreground

  • OS Information: Please ssh into the device via vega exec vda shell (or kepler exec vda shell for v0.21 and earlier) and copy the output from cat /etc/os-release into the answer section below. Note, if you don’t have a simulator running or device attached, the command will respond with vda: no devices/emulators found

    NAME="OS"
    OE_VERSION="4.0.0"
    OS_MAJOR_VERSION="1"
    OS_MINOR_VERSION="1"
    RELEASE_ID="10"
    OS_VERSION="1.1"
    BRANCH_CODE="TV Ship"
    BUILD_DESC="OS 1.1 (TV Ship/518)"
    BUILD_FINGERPRINT="4.0.194174.0(3072cab629675a74)/518N:user/release-keys"
    BUILD_VARIANT="user"
    BUILD_TAGS="release-keys"
    BUILD_DATE="Fri Dec 12 05:48:51 UTC 2025"
    BUILD_TIMESTAMP="1765518531"
    VERSION_NUMBER="1001010051820"
    

7. Example Code Snippet / Screenshots / Screengrabs


:backhand_index_pointing_right: Playback Issues


If this is a playback issue, please provide your content URL, any pre-conditions (like geo-location), and let us know if it’s x86 or arm7.

N/A

:backhand_index_pointing_right: Additional Context


Any Additional Context you would like to provide?
Add any other relevant information, such as recent updates to the SDK, dependencies, or device OS that may affect the bug.

N/A

Hi @John_Zhang,

Thank you for the detailed bug report on the TextInput keyboard focus issue.

Our team is investigating this issue and will provide an update as soon as we have more information.

Thanks for helping us improve the Vega platform.

Warm regards,
Aishwarya

We have similar issue. On Android, it can be fixed by passing caretHidden={!Keyboard.isVisible()} But on Vega, it doesn’t work the same way. Vega simply ignores caretHidden value.

Hi @Liudmyla,

Can you please share the minimal reproducible code snippet with us and any other details that will help us debug this?

Thanks,
Rohit

It’s pretty simple: TextInput to the right and some Pressable element to the left.

<View style={{flexDirection: 'row'}}>
  <Button
    label={i18n.globalButtonBack()}
    onPress={navigateBackOrHome}
  />
  <TextInput
     style={styles.inputField}
     value={inputText}
     onChangeText={setInputText}
     onSubmitEditing={handleOnSubmitEditing}
     caretHidden={!isKeyboardVisible} // is ignored
  />
<View>

Pressing left each time from the TextInput moves focus to the Button, but also moves cursor to the previous symbol.

Hi @John_Zhang,

Could you please share a minimal reproducible code snippet along with any additional details that would help us debug the issue further?

Warm regards,
Aishwarya

Hi @amen ,

I believe @Liudmyla shared a pretty similar snippet as what we have.

<View style={{flexDirection: ‘row’}}>
    <TextInputstyle={{width: 500}} value={inputText} onChangeText={setInputText}/>
    <Button />
</View>

Hey, I also noticed that it doesn’t support cursorColor and setSelection method, which could help fixing this issue.

Hi @Liudmyla , @John_Zhang ,

Thanks for sharing the info.

Our team is still looking into this. We will get back once we have an update.

Regards,
Rohit

Hi @John_Zhang , @Liudmyla ,

Unfortunately, we are unable to reproduce the issue with the shared code snippet.
Could you please share the simple vpkg or app.tsx with your Amazon POC please?

Thanks
Rohit

Hi @Amz_Rsk , I have provided a video and code sample to @satish_amazon .

Hi @Liudmyla ,

Can you also please share the simple vpkg or app.tsx with your Amazon POC please?

Thanks,
Rohit