-
Notifications
You must be signed in to change notification settings - Fork 29.7k
TextFormField does not get blurred when tapped outside of the widget. #74354
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
* Add optional argument (forceCloseConnectionOnBlur) to TextField * This PR is meant to accompany this change to flutter/engine flutter/engine#22517
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
oops sorry I'll take a look tonight. |
| this.autofocus = false, | ||
| this.obscuringCharacter = '•', | ||
| this.obscureText = false, | ||
| this.forceCloseConnectionOnBlur = false, |
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.
We probably shouldn't mention "connection" in the text field api. Even to EditableText if feels the "connection" should be an implementation detail.
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 agree, connection should be an implementation detail. I changed this to forceSubmitOnFocusLost, because the onSubmitted callback will be invoked when the user clicks out of the text field.
| /// Defaults to false. | ||
| final bool obscureText; | ||
|
|
||
| /// Previously, Flutter for Web behaved like a web page. If user clicked on an |
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.
Most developers won't be too interested in the story behind the parameter. These should probably be code comments.
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 removed the story and included a brief description of the behavior.
| /// https://github.com/flutter/flutter/issues/64245 | ||
| /// | ||
| /// This flag provides a workaround to the regression allowing developers to | ||
| /// optionally force the connection to close on blur, as suggested in the comments |
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.
Could you explain in the documentation what "blur" means?
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 changed "blur" to "focus lost". Blur is the opposite of focus, but saying "focus lost" is probably easier to understand.
* Add optional argument (forceSubmitOnFocusLost) to TextField * This PR is meant to accompany this change to flutter/engine flutter/engine#22517
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
@LongCatIsLooong is there anything still to be done following last review cycle? |
|
(triage) Hi @stevenmetzger would you like to continue with this change? |
|
Hi @Piinks, yes I would like to continue with this change. But it's been here for so long that the corresponding change to flutter/engine is out of date. If I were to rebase both of these changes would they go through? What is the next step to continue here? Sorry for being unfamiliar with the process, this is my first commit to this project. |
|
From my reading of flutter/engine#22517 , it sounds like this might be fixed via #82575 |
|
Thanks @jonahwilliams! @stevenmetzger can you confirm that the issue you were trying to resolve is fixed? If so, we can close these changes. |
|
Hi @Piinks @jonahwilliams we opened the issue that this PR fixes: https://github.com/flutter/flutter/issues/64245#issuecomment-681815149. |
|
In that case I don't believe you need an engine change, just an update to the text field to submit when focus is lost. |
|
This PR has not been updated in a while, and it currently is failing several tests. I am going to close it for now, but if you would like to return to this change, please feel free to re-open it. Thank you for the contribution! |
This PR adds support the optional argument (forceSubmitOnFocusLost) to TextField. This is needed to complete work on flutter/engine#22517. This PR was requested during review flutter/engine#22517 (review).
This fixes the following regression:
Fixes #64245
This fix was proposed in the comments of this issue here:
#64245 (comment)
Pre-launch Checklist
///).