Skip to content

[Android]serious problem, using a physical keyboard doesn't work to select which part of the text to write in #2534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
jonasbernardo opened this issue Apr 5, 2025 · 7 comments
Labels
android Issues or feature requests specific to the Android platform. bug Something isn't working moderate Issues that are important for improving functionality or user experience. reproducible This bug has been confirmed and can be reliably reproduced.

Comments

@jonasbernardo
Copy link

Have you checked for an existing issue?

Flutter Quill Version

11.2.0

Steps to Reproduce

tap anywhere on the text in the quill example

try to type with the physical keyboard

tap with mouse or finger on another part of the text

try to type with physical keyboard

WhatsApp.Video.2025-04-05.at.06.28.24.mp4

Expected results

that the keyboard writes in the part I touched where the cursor appeared

Actual results

write to the old cursor

Additional Context

WhatsApp.Video.2025-04-05.at.06.28.24.mp4
Screenshots / Video demonstration

[Attach media here]

Logs
[Paste logs here]
@jonasbernardo jonasbernardo added the bug Something isn't working label Apr 5, 2025
@jonasbernardo jonasbernardo changed the title serious problem, using a physical keyboard doesn't work to select which part of the text to write in [Android]serious problem, using a physical keyboard doesn't work to select which part of the text to write in Apr 5, 2025
@jonasbernardo
Copy link
Author

If you delete everything and there are few lines, this problem does not occur, but if there are many lines this problem appears.

@jonasbernardo
Copy link
Author

tested with flutter 3.29.2, 3.27.3
tested with flutter_quill: 11.2.0, v11.0.0-dev.21, v11.0.0-dev.20, v10.8.5
all have the same problem

@CatHood0
@EchoEllet

@CatHood0
Copy link
Collaborator

CatHood0 commented Apr 5, 2025

This is already being fixed on #2510

@jonasbernardo
Copy link
Author

jonasbernardo commented Apr 17, 2025

@CatHood0
@EchoEllet
I tested using the modifications made and the problem persists, could you give me any tips so I can fix it?

the physical keyboard does not type in the correct position using the mouse or finger to change the position, only the virtual keyboard types in the right place
https://github.com/CatHood0/flutter-quill/tree/better_soft_keyboard_support

teste.Jonas.mp4

@CatHood0
Copy link
Collaborator

could you give me any tips so I can fix it?

I can't give you any type, as I have no idea what could be causing this. In fact, since it was updated to use Flutter versions after 3.24, which have had many problems since then.

@Lamda303
Copy link
Contributor

@CatHood0 @jonasbernardo The root cause is that _keyboardVisible in raw_editor_state.dart remains false when using a physical keyboard. While QuillRawEditorState attempts to detect hardware keyboard visibility through _hardwareKeyboardEvent(), typing alphanumeric characters (a-z, 0-9) does not trigger this callback. However, when pressing modifier keys (such as Shift, Backspace, or Tab), the detection works as expected and _keyboardVisible is properly set to true.

@EchoEllet
Copy link
Collaborator

The root cause is that _keyboardVisible in raw_editor_state.dart remains false when using a physical keyboard. While QuillRawEditorState attempts to detect hardware keyboard visibility through

That's actually a good explanation. One way to work around it is to detect whether a physical keyboard is being used via platform specific code.

@EchoEllet EchoEllet added android Issues or feature requests specific to the Android platform. reproducible This bug has been confirmed and can be reliably reproduced. moderate Issues that are important for improving functionality or user experience. labels Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Issues or feature requests specific to the Android platform. bug Something isn't working moderate Issues that are important for improving functionality or user experience. reproducible This bug has been confirmed and can be reliably reproduced.
Projects
None yet
Development

No branches or pull requests

4 participants