TextInput components to prevent unexpected behavior. The onSubmitEditing() callback fires for multiple keyboard actions, including show and hide password toggles. Without checking which action triggered the callback, your business logic (such as connecting to a network) might execute when a user simply toggles password visibility.
Prerequisites
- Vega development environment set up
- React Native app using the
TextInputcomponent withkeyboardTypeset topassword
Determine if your app is affected
Your app needs this fix if both of the following are true:- You use the
TextInputcomponent withkeyboardTypeset topasswordand show/hide password buttons in the keyboard UI. - You process
onSubmitEditing()without checking the value ofe.nativeEvent.submitAction.
Add the submitAction check
Filter theonSubmitEditing() callback by checking e.nativeEvent.submitAction before running your business logic. This makes sure only the intended action (such as “done”) triggers your code.
Handle additional submitAction values
You might want to respond to other submit actions beyond “done”. ThesubmitAction value corresponds to returnKeyType values plus custom values set using auxOptions. The following example shows how to handle password visibility toggles alongside the done action.
submitAction values include “go”, “search”, “next”, and “previous”.

