Skip to main content

NativeVoiceTextEditBox

NativeVoiceTextEditBox extends TextEditBox with native dictation fields and native-IME focus control.

NativeVoiceTextEditBox({
id: 'search',
text: this.query,
placeholderText: 'Search',
hintText: 'Search',
voiceEnabled: true,
voiceEntryType: 'generic',
})
.onTextChange((event) => {
this.query = event.text ?? '';
})
.onDictatingChange((event) => {
this.isDictating = event.isDictating === true;
})
.onSubmit(() => {
this.runSearch();
});

In addition to TextEditBox fields, it exposes placeholderText, voiceEnabled, voiceEntryType, voiceInputRegexFilter, voiceToolTipWidth, backgroundUri, backgroundBlendColor, textFontSize, onDictatingChange, and onSubmit. Its default size is 400×50.

Call focusNativeInput() to make the field the native first responder and blurNativeInput() to dismiss editing.

Roku's native VoiceTextEditBox does not support voiceToolTipWidth, backgroundBlendColor, or textFontSize; Hosanna applies those fields only on other targets.

Talk to us