mask_text_input_formatter icon indicating copy to clipboard operation
mask_text_input_formatter copied to clipboard

[Android] Automatic keyboard switch for no reason

Open maxim-gapeenko-idf opened this issue 4 years ago • 7 comments

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.

maxim-gapeenko-idf avatar Aug 03 '21 11:08 maxim-gapeenko-idf

Might have to do something with Flutter instead of your library, but leaving here so that you can investigate yourself further.

maxim-gapeenko-idf avatar Aug 03 '21 15:08 maxim-gapeenko-idf

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.

mflesh1 avatar Sep 30 '21 20:09 mflesh1

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.

AndreyWV avatar Jan 20 '22 11:01 AndreyWV

Same issue here. Is there any workaround for this?

My mask: MaskTextInputFormatter( mask: '#######', filter: {"#": RegExp(r'[A-Z0-9]')} );

thalesvinicius26 avatar Apr 12 '22 18:04 thalesvinicius26

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,
            ),

Ticunas avatar Apr 26 '22 16:04 Ticunas

Is there any update?

RusKryzhanovskiy avatar Aug 04 '22 15:08 RusKryzhanovskiy

Could be linked to flutter/flutter#122721?

pongloongyeat avatar May 05 '23 16:05 pongloongyeat