-
Notifications
You must be signed in to change notification settings - Fork 907
Text highlighting/selection issue with Flutter 3.27.2 on Web #2450
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
Comments
Could you try with |
Hi @EchoEllet, just tried with 11.0.0-dev.21, and it's still happening for me unfortunately. Screen.Recording.2025-01-21.at.10.29.06.PM.movAny other ideas? Thanks! |
Is this issue encounterable on Android and iOS, or is this a desktop specific issue? |
For now we have only seen it on web but I have not tried on the native apps yet, I can get you that information tomorrow. The main problem we have is that we have the Flutter bug with iOS 18.2 which means that scrolling on iOS web does not work since we still run Flutter 24, but upgrading to 27 causes this issue so I’m stuck in between both. Any help would be amazing! |
I tested it here, on Android the selection with a bluetooth mouse works normally, the problem only happens in the web version, another problem is also when clicking on empty lines, the cursor always appears on the top line and not on the clicked line, but it needs to be between two text when there is an empty space |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Is this a different issue than the text selection? |
Yes that is a separate bug that is not related to flutter-quill at all, sorry for the confusion here. But it's a bug that forces us to update Flutter version, except that we cannot because of this bug @EchoEllet . |
I cannot reproduce this issue in Flutter 3.27.3 and the package version |
This comment has been minimized.
This comment has been minimized.
yes, the problem persisted, I recorded a video running the example within the flutter quill package bug-selecao.mp4 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
i have same issue. did you fix it? 2025-02-13.1.46.04.mov |
I just tried with the latest Flutter 3.29.0 stable release and unfortunately this still reproduces. @CatHood0 are you maybe able to reproduce? Can this get investigated in some way? I'm happy to help contribute but not quite sure where to start on this issue. Thanks a lot. |
This comment has been minimized.
This comment has been minimized.
@bloemy7 |
Is this the same issue in flutter dev tools? For example, in dev tools -> network -> select a request -> goto the Response tab on the right side, select some text and a similar issue occurs if the text is multi line.
|
update from my latest tests: text selection only works in mozilla firefox |
I am experiencing the same issue in all browsers except Safari and Firefox. Flutter version: 3.27.2. |
@jonasbernardo |
Hi everyone, I'm encountering the same issue. I noticed that adding the following code:
is causing the selection to extend four lines above the text I want to select. Without this, it only selects the line I want plus one. Has anyone else experienced this? flutter 3.27.3 | quill 11.0.0 | testing on chrome |
@CatHood0 it seems like this issue is becoming more widespread and probably should be more thoroughly investigated at this point as it makes the editor as such unusable. If anyone has any thoughts on how to proceed here it would be great... |
below is my quillEditor setting.
|
@RJustoX Edit: |
@dominikkeller |
This comment has been minimized.
This comment has been minimized.
I can confirm the issue, reproduced on Google Chrome using Flutter stable 3.29.0 Dart 3.7.0. WebBug.mov |
This comment has been minimized.
This comment has been minimized.
I have this problem on windows 11 |
For me, I encountered the same issue with Flutter's native TextField. When I tried replacing TextField with Quill, the problem still persisted. Maybe this issue is not related to Quill itself. Flutter: 3.27.4 |
I also have same issue. Flutter: 3.27.4 |
Just wanted to confirm that I´m having the same issue when using quill editor in chrome.. both in windows and android. Oddly enough this does not happen when using firefox on windows. Flutter: 3.29.2 |
Hey guys, put together a PR for tihs: Fixes an issue in the Flutter engine |
I knew I wasn't crazy! But I really didn't know where the problem lay in Flutter (I don't quite understand the project structure). I'm glad you're getting it fixed. Thanks for taking the time to do this and let us know! |
Yeah you aren't crazy. It's impacting every editor and the core text fields. I've also seen impacting re_editor as well. Glad to help out. Seems to be a fairly widespread problem for anything editing text on web in the last few releases. |
Unfortunately the fix doesn't work. Fixes the position while dragging, but makes it wrong when the mouse gets released... |
@aleripe I discovered the real problem was a bit deeper in the engine and also impacted scrollbars due to improper mouse pointer calculation. If you are running Flutter 3.29.2 and want a patch so scrollbars and textboxes aren't screwed up. Replace your flutter_web_sdk in flutter/bin/cache with the one in here: https://storage.googleapis.com/flutter-builds/releases/3.29.2/flutter_web_sdk.zip Will push the patch to flock later this week. Let me know if you have issues with it. The mouse position is correct on drag and release. Also fixes the scrollbars. |
Thanks for your kind reply! I just tried your patch and it works, indeed. |
Yeah not giving up on Flutter, just taking a different path. Anyone can always do a PR with any flock patch back to Flutter. I just would rather spend my time fixing things than fighting the system :) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Any updates? Is there any Flutter version where this error doesn’t occur? I've tested it with flutter_quill version 10.8.3, and the issue still persists, so it does seem very likely to be a Flutter engine issue as mentioned. If there’s a specific older version of Flutter where this bug doesn’t happen, I’d really appreciate knowing about it. |
Fixes #167805 Fixes #162698 ### Description First of all, I would like to thank @jezell for posting their fix of this selection issue: singerdmx/flutter-quill#2450 (comment) The issue with selection is happening because in Chrome `pointermove` event and its coalesced events have some different targets. @mdebbar already spotted this behavior some time ago and even filed a Chrome bug: flutter/engine#56949 (comment) This jsfiddle allows reproducing the bug: https://jsfiddle.net/knevercode/y2hpfmrb/2/ On the following recording, you can see the events' targets and their bounding boxes. <video src="https://github.com/user-attachments/assets/82af8d86-2cfe-4e36-a977-46ffa58facdb"/> Those coalesced events have their `offsetX` and `offsetY` values relative to the dummy `div` target. So to fix that, we have to translate those values to be relative to the actual target. This PR does exactly this in `_computeOffsetForInputs` when `event.target != eventTarget` . | Before | After | | - | - | | https://chrome-input-selection-bug.web.app | https://chrome-input-selection-fix.web.app | | <video src="https://github.com/user-attachments/assets/1e10b43a-ff4f-46e8-8977-ee435f9d78fb"/> | <video src="https://github.com/user-attachments/assets/a997bfd0-8361-4bb3-910c-58cfc6b5d426"/> | ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [X] I signed the [CLA]. - [X] I listed at least one issue that this PR fixes in the description above. - [X] I updated/added relevant documentation (doc comments with `///`). - [X] I added new tests to check the change I am making, or this PR is [test-exempt]. - [X] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [X] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
I'm facing the same issue, and I can confirm that it occurs specifically on Web with Chrome engine (on Edge and Opera too), but it's OK with Firefox and Safari, also OK on Desktop. I've tried the current fix version here : Based on the last flutter_quill version 11.4.1 with flutter_quill_extensions version11.0.0, and unfortunately the pb still occurs... There is also a concrete pb with scrolling down when selectionning. This video shows comparison between flutter_quill and simple multiline TextField : flutter_quill_Text.highlighting_selection_issue_compressed.mp4 |
Have you checked for an existing issue?
Flutter Quill Version
10.8.5
Steps to Reproduce
Expected results
Expecting to be able to smoothly select text
Actual results
Almost impossible to select text as it auto-select multiple lines in a very buggy way
Additional Context
I have downgraded Flutter to 3.27.1 and 3.27.0, but there when selecting text it doesn't show the resulting highlight as you are dragging, only once you release the drag, which is not a good experience either.
Any ideas?
The text was updated successfully, but these errors were encountered: