[Android] Automatic keyboard switch for no reason
When I enter any letter into a field with a mask on android, any following digit inputs will trigger keyboard to change from digits to letters. Only after entering few digits in a row keyboard changes will stop occuring.
Here is the video of the bug: https://vimeo.com/582486275.
Used mask:
MaskTextInputFormatter(
mask: '#### #### #### #### #### ####',
filter: {'#': RegExp(r'[A-Za-z0-9]')},
);
Android 9 HTC U 11
Keyboard: Gboard.
But it seems the bug can be reproduced on any android device.
Might have to do something with Flutter instead of your library, but leaving here so that you can investigate yourself further.
This is happening to me as well, the format I am using is:
MaskTextInputFormatter phoneFormatter = new MaskTextInputFormatter(mask: '(###) ###-####', filter: { "#": RegExp(r'[0-9]') });
keyboardType: TextInputType.numberWithOptions(signed: true, decimal: false)
I can recreate it consistently by typing 1234 and when I type 4 the keyboard switches, if I switch back to the number keyboard and type any other character but 4 it works.
Same issue. My mask:
MaskTextInputFormatter(
mask: 'T NNN TT NN',
filter: {
'T': RegExp(r'[АВЕКМНОРСТУХ]'),
'N': RegExp(r'[0-9]'),
},
)
Keyboard switched after typing second symbol (first number N).
Android 11 Pixel 2 emulator. Gboard.
Same issue here. Is there any workaround for this?
My mask: MaskTextInputFormatter( mask: '#######', filter: {"#": RegExp(r'[A-Z0-9]')} );
Same here,
When I change the keyboard to only show numbers and press any key, the keyboard change to default (letters).
var userFormatter = MaskTextInputFormatter(mask: '##.###.###');
TextField(
textInputAction: TextInputAction.next,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'User',
),
inputFormatters: [userFormatter],
textAlign: TextAlign.center,
),
Is there any update?
Could be linked to flutter/flutter#122721?