Fix Keyboard Type Handling by Adding Input Formatter for Number Input in Flutter DivKit
In the web playground, when the keyboard_type is set to number in JSON, the client-side ensures that users can only input and paste numeric values. However, in the Flutter DivKit, setting the keyboard_type to number only displays the numeric keyboard, but users can still paste or type non-numeric strings. This behavior is inconsistent with the web version, where non-numeric inputs are restricted.
Changes Introduced:
- Added an inputFormatter to DivInput in Flutter DivKit.
- The inputFormatter is set to digitsOnly when keyboard_type is number, ensuring users can only input numeric values.
- For all other keyboard_type values, the inputFormatter is set to none, allowing normal string input.
Impact:
- Ensures consistency between the web and Flutter versions regarding input behavior for numeric fields.
- Prevents users from inputting or pasting non-numeric values when keyboard_type is number in Flutter DivKit.
Testing:
- Verified that when keyboard_type is set to number, users can only input numeric values.
- Confirmed that for other keyboard_type values, normal string input is allowed.
The branch has a conflict and an incorrect diff. Please make a diff that includes only changes that add functionality
And check out the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Nothing happens here, conflicts are not resolved yet.