Skip to main content

TextEditBox

TextEditBox wraps the active platform's SceneGraph-compatible text-edit renderer. Use it when the native edit surface should appear directly, without TextInput's TV keyboard-dialog presentation.

TextEditBox({
text: this.value,
hintText: 'Enter text',
maxTextLength: 64,
cursorPosition: this.value.length,
})
.onTextChange((event) => {
this.value = event.text ?? '';
})
.onSubmit((event) => {
this.save(event.text ?? '');
});

Key fields are:

  • text, hintText, and secureMode;
  • cursorPosition and maxTextLength;
  • clearOnDownKey;
  • textColor and hintTextColor;
  • width (default 300) and height (default 40);
  • onTextChange; and
  • onSubmit.

onTextChange includes text; cursor movement is retained in cursorPosition. onSubmit is generated by Enter/Done on web and emulated keyboard paths. Native IME flows use NativeVoiceTextEditBox.

Talk to us