flutter_chat_ui icon indicating copy to clipboard operation
flutter_chat_ui copied to clipboard

SendButtonVisibilityMode.editing: send button not added after typing on samsung keyboard

Open qeepcologne opened this issue 11 months ago • 7 comments

i am using InputOptions with sendButtonVisibilityMode: SendButtonVisibilityMode.editing (show the button when trimmed text is not empty). This is working fine with gboard. But with samsung keyboard, button is not becoming visible after i type some characters (only after i close the keyboard). I could reproduce this on 2 different devices and when i switch to gboard, everything works fine. I added onTextChanged and it is called after every character typed with both keyboards. So, i do not understand why the button is not updated. This might be a bug in TextEditingController, but even if so, we need a workaround here.

qeepcologne avatar Feb 28 '24 09:02 qeepcologne

I faced the same problem on Xiaomi The button appears after closing the keyboard, or after adding a space

levmorgot avatar Mar 02 '24 14:03 levmorgot

could you try one thing - there is this textEditingController that kind of transforms input text with a simple markdown - could you disable it using inputOptions and pass Flutter's own TextEditingController() to the textEditingController option? cause otherwise code is pretty straightforward,textEditingController.text != ''

demchenkoalex avatar Mar 03 '24 13:03 demchenkoalex

thanks a lot for your answer. I tried like this: Chat(... , inputOptions: InputOptions(textEditingController: TextEditingController(), )

without any change (working fine with gboard, send button not visible on samsung keyboard until keyboard closed or space added.

qeepcologne avatar Mar 04 '24 08:03 qeepcologne

so it didn't help right? can you just build a simple flutter text field with controller and try it on your device? might be a bug in flutter? cause after this change it seems like there is no other logic..

demchenkoalex avatar Mar 04 '24 18:03 demchenkoalex

here is my workaround - looks like a flutter bug:

  TextEditingController textController = TextEditingController();


                  inputOptions: InputOptions(
                      onTextChanged: (text) {
                        setState(() {
                          textController.text = text;
                        });
                      },
                      textEditingController: textController,
                  ...

i also tried textController.notifyListeners() without success.

qeepcologne avatar Mar 05 '24 09:03 qeepcologne

ah so I need to call setState? will keep this in mind for v2

demchenkoalex avatar Mar 06 '24 20:03 demchenkoalex

have the same issue on s23 plus with swiftkey (haven't checked other devices)

yevgeniaronov avatar Mar 08 '24 18:03 yevgeniaronov