-
Notifications
You must be signed in to change notification settings - Fork 29.7k
TextField should only set EditableText.cursorOffset for iOS #27663
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
Conversation
| TextSelectionControls textSelectionControls; | ||
| bool paintCursorAboveText; | ||
| bool cursorOpacityAnimates; | ||
| Offset cursorOffset; |
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.
Do we not need the default value of 2 coming from the widget.cursorOffset?
Some random yak shaving while we're here. I had to click through all the editables to realize that RenderEditable handles nulls. Can we add it to the doc?
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 also thing I'm leaning towards liking the getters more. It takes less effort to read and realize that we're only dealing with an Android and an iOS value and don't have to follow the local variable through to watch out for the fallthrough/null case.
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 cursorOffset is only defined for iOS.
I moved the couple of getters that were returning platform-specific values to the block of code that handles configuring the EditableText's other platform-specific values because it's easier to read (all in one place), simpler, and that's the way the rest of it already was.
I'll be happy to add some documentation about null parameters to RenderEditable in a separate PR.
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.
oops, sorry, there is no widget.cursorOffset. I misread widget.cursorWidth
| expect(textField.cursorRadius, const Radius.circular(3.0)); | ||
| }); | ||
|
|
||
| // TODO(hansmuller): restore these tests after the fix for #24876 has landed. |
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.
Not sure what this comment means. Isn't this PR the fix for the fix for #24876?
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.
Yes. I was going to land the fix and then update the golden images and then update this test.
|
LGTM |
|
cc @jslavitz |
Fixes #27626
Restored the Material textfield tests that were changed in #24876.
Cleaned up the platform-specific configuration code in _TextFieldState.build().