Closed kopax-polyconseil closed 3 years ago
const codeInputPlaceholder = ('0' + '\u00a0'.repeat(5)).repeat(5) + '0' const codeInputMask = ('9' + ' '.repeat(5)).repeat(5) + '9' // ... <MaskedTextInput onChangeText={(text, rawText) => { onChangeValue(rawText ?? '') }} placeholder={codeInputPlaceholder} placeholderTextColor={ColorsEnum.GREY_DARK} mask={codeInputMask} keyboardType="number-pad" testID="code-input" />
It should have caret positionned before letter when typing
Caret is located after the last typed character:
Caret should be before next character to be typed.
Ex: in previous screen, it should be located right before the 5, not right after the 1
5
1
Version: 0.2.2
PR :
https://github.com/pass-culture/pass-culture-app-native/pull/1469
résolved using maxLength and letterSpacing
Steps to reproduce
Expected behaviour
It should have caret positionned before letter when typing
Actual behaviour
Caret is located after the last typed character:
Caret should be before next character to be typed.
Ex: in previous screen, it should be located right before the
5
, not right after the1
Environment
react-native-mask-text
Version: 0.2.2
Link to repo (highly encouraged)
PR :
https://github.com/pass-culture/pass-culture-app-native/pull/1469