-
-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Describe the Feature
I think it would make sense to make the MaskedTextInput component fallback to the normal TextInput behaviour when the mask property is undefined. This would mean that anything written in the input would be passed on in both text and rawText.
Possible Implementations
export const CustomInput = ({...props}: CustomInputProps) => {
const [value, setValue] = React.useState('Hello world')
const handleChangeText = React.useCallback((text, rawText) => {
console.log('text:', text)
console.log('rawText:', rawText)
setValue(text)
}, [])
return (
<MaskedTextInput
mask={undefined}
onChangeText={(text, rawText) => setValue(text)}}
value={value}
{...props}
/>
)
}
// Typing "!" suffixed on "Hello world" in the input
// text: Hello world!
// rawText: Hello world!
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request