Skip to content

Commit e306d1b

Browse files
laynorardera
authored andcommitted
Do not filter text field input based on selected keyboard type.
On standard flutter, no input filtering is done based on the keyboardType parameter of the TextField constructor. Input filtering should be done via the inputFormatters parameter of the TextField constructor. See https://api.flutter.dev/flutter/services/TextInputFormatter-class.html
1 parent 2158102 commit e306d1b

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

src/plugins/text_input.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -876,23 +876,6 @@ static int sync_editing_state(void) {
876876
int textin_on_utf8_char(uint8_t *c) {
877877
if (text_input.connection_id == -1)
878878
return 0;
879-
880-
switch (text_input.input_type) {
881-
case kInputTypeNumber:
882-
if (isdigit(*c)) {
883-
break;
884-
} else {
885-
return 0;
886-
}
887-
case kInputTypePhone:
888-
if (isdigit(*c) || *c == '*' || *c == '#' || *c == '+') {
889-
break;
890-
} else {
891-
return 0;
892-
}
893-
default:
894-
break;
895-
}
896879

897880
if (model_add_utf8_char(c))
898881
return sync_editing_state();

0 commit comments

Comments
 (0)