-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Fix the position of the Android-style spell check toolbar #124897
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
Fix the position of the Android-style spell check toolbar #124897
Conversation
The position should be right below the underline and I think you are right -- the handle should be hidden. I've seen it look exactly like https://developer.android.com/develop/ui/views/touch-and-input/spell-checker-framework#SpellCheckClient on emulators. |
The failures are caused by #125144. I'll push a merge commit once that's merge and it should be green. |
@@ -3990,7 +3990,8 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien | |||
|| platformNotSupported | |||
|| widget.readOnly | |||
|| _selectionOverlay == null | |||
|| !_spellCheckResultsReceived) { | |||
|| !_spellCheckResultsReceived | |||
|| findSuggestionSpanAtCursorIndex(textEditingValue.selection.extentOffset) == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great fix!
@@ -180,7 +182,7 @@ class SpellCheckSuggestionsToolbar extends StatelessWidget { | |||
return Padding( | |||
padding: EdgeInsets.fromLTRB( | |||
CupertinoTextSelectionToolbar.kToolbarScreenPadding, | |||
kToolbarContentDistanceBelow, | |||
paddingAbove, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this?
I think kToolbarContentDistanceBelow doesn't apply to the spell check toolbar then, if we want it right below the anchor. I removed it from this file, so I'll watch out for a breaking change in case someone was using it already.
Also by the way, the lack of red underline and red selection has me worried. Is that something we should open an issue for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok sounds good! This looks better.
In terms of the red underline/red selection, I revisited some notes I took and seems like that is behavior that differs based on Android version. So, we can open an issue to track it, but just FYI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created an issue here: #125424
5e54391
to
01a050d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new value looks good to me!
…4897) The spell check menu now appears directly below the misspelled word on Android.
This is a cherry pick of 8 of my recent spell check bug fixes into the beta branch. 1. #124259 2. #124875 3. #124254 4. #124899 5. #124895 6. #125162 7. #124897 8. #125432 This is the behavior of spell check with these changes: | Screenshot | Video | | --- | --- | | <img src="https://user-images.githubusercontent.com/389558/234087650-bcd62c89-03e7-427d-afc5-0fe8f96a5f80.png" /> | <video src="https://user-images.githubusercontent.com/389558/234087667-651b0fde-348c-467e-ba00-27b6b3966a27.mov" /> | CC @itsjustkevin @leighajarett
Bonus "after" gif:
Some open questions @camsim99:
Partial fix for: #124882