Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
In this article, you’ll add submit action filtering to password 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

Determine if your app is affected

Your app needs this fix if both of the following are true:
  • You use the TextInput component with keyboardType set to password and show/hide password buttons in the keyboard UI.
  • You process onSubmitEditing() without checking the value of e.nativeEvent.submitAction.
For example, the following code triggers the password handler for any submit action, including show and hide password toggles.

Add the submitAction check

Filter the onSubmitEditing() 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”. The submitAction 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.
Other possible submitAction values include “go”, “search”, “next”, and “previous”.
Last modified on April 15, 2026