Skip to content

fix(android): mask secure input in BareTextInputRenderer - #54

Open
unlocdavid wants to merge 1 commit into
NativePHP:mainfrom
unlocdavid:fix/android-bare-text-secure-masking
Open

fix(android): mask secure input in BareTextInputRenderer#54
unlocdavid wants to merge 1 commit into
NativePHP:mainfrom
unlocdavid:fix/android-bare-text-secure-masking

Conversation

@unlocdavid

Copy link
Copy Markdown

On Android, secure has no effect on <native:bare-text-input> — the password renders in the clear.

BareTextInputRenderer builds its own BasicTextField and never passes visualTransformation, so the secure prop is parsed into TextInputProps (TextInputShared.kt:112) and mapped to PasswordVisualTransformation() (TextInputShared.kt:75-76), but never reaches the field.

Changes

  • Injected visualTransformation = props.visualTransformation into the BasicTextField constructor. No new import — the property is already typed on TextInputProps.

Notes

  • The outlined and filled renderers already pass it (OutlinedTextInputRenderer.kt:157, FilledTextInputRenderer.kt:144).
  • iOS is unaffected — its bare renderer delegates to NativeUITextInputCore.
  • Same class of omission as fix(android): apply keyboardOptions to BareTextInputRenderer #51 (props parsed, never wired), different argument. Placed next to singleLine to avoid conflicting with that PR.
  • keyboard="password" does not substitute: KeyboardType.Password is an IME hint, not a display transform.

The bare renderer builds its own BasicTextField and never passed
visualTransformation, so `secure` parsed but never reached the field
and the password rendered in the clear. Outlined and filled already
pass it; iOS is unaffected because its bare renderer delegates to
NativeUITextInputCore.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant