-
-
Notifications
You must be signed in to change notification settings - Fork 147
Description
On a few android devices (so far all from Samsung) the backspace on the virtual keyboard of the device, doesn't so anything.
It doesnt delete chip nor text.
The same code works perfectly on all iOS devices and other Android devices.
I noticed that on Web, the backspace of a real keyboard, doesn't do anything.
So I tried to do this, in the chips_input code, I added this snippet:
RawKeyboardListener(
focusNode: _effectiveFocusNode,
onKey: (event) {
if (event.isKeyPressed(LogicalKeyboardKey.backspace)) {
setState(() {
_value = _value.copyWith(
text: "",
selection: TextSelection.collapsed(offset: 0),
composing: TextRange.empty,
);
});
})
so basically I m emptying manually the whole _value, and this works on the Android devices where the backspace is not working.
So this means that on those Android devices, the virtual keyboard is actually considered as a "RawKeyboard" as on those Devices, this listener is firing!
But the same code, on the devices where we have no issue with backspace, this code snippet does not fire!
Any suggestions?
And how can I adjust the code, so when a "backspace" is found on a RawKeyboard, it just deletes the last character or removes the latest chip if no text.