-
Notifications
You must be signed in to change notification settings - Fork 6k
Fix done button click not blur in iOS keyboard #31718
Conversation
CC @mdebbar |
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 elaborate a little more about how this PR fixes the clicks on "done"?
Thanks for reviewing. In the beginning, I found that taping the 'done' button above the soft input in iOS Safari was not working correctly as the keyboard closed and opened up again. When pressing the 'done' button, the event listener 'onblur' should trigger a callback then the keyboard should be closed normally. The reason why the keyboard kept opening up was that the window was still on focus. I was trying to remove everything except 'owner.sendTextConnectionClosedToFrameworkIfAny' in the 'onblur' listener callback. But a new problem occurred, which was tapping the TextInput could not bring up the keyboard occasionally. I figured out the 'onblur' listener callback was triggered, as long as the listener had set up after a while. It should call by mistake. Having tested several times, I found that the intervals between the 'onblur' event listener registered and callback triggered were below 200ms. It was considered a fast callback, which should regain focus instead of blur. Please let me know if there's any other way I can do better. |
Thanks for the explanation! I'm still trying to understand the "fast callback". Here's my understanding of the sequence of things: The Why does the duration between these two things matter? And in what situation does the |
It could be more clear to deduce matters in this way. The current situation:
The current keyboard action:
If we apply the 'fast callback' solution, then:
The solved keyboard action:
Hopefully can answer your questions. |
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.
Thanks for the great explanation! I added a suggestion on how to incorporate it in the doc comments. Feel free to re-phrase it if needed.
Co-authored-by: Mouad Debbar <[email protected]>
Co-authored-by: Mouad Debbar <[email protected]>
I appreciate the time and effort you have spent to share your insightful comments, which will be helpful to improve code readability. |
Thanks for contributing this fix to the flutter web engine! |
This pull request is not suitable for automatic merging in its current state.
|
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.
LGTM 👍
Just some small nits for my opinion on making the docs more readable, but it's up to you.
Thanks for your suggestion. I've done it. |
* 09d7bcc Optionally specify the target dir in tools/gn (flutter/engine#32065) * a00ba24 Fix done button click not blur in iOS keyboard (flutter/engine#31718) * 81547d1 Add a display list op to clear to transformation stack. (flutter/engine#32050) * 2309bcc Add WASM target in gn (flutter/engine#31670) * 852e800 [web] Remove the --passfail flag when calling goldctl in post-submit (flutter/engine#32071) * eb1c50d Fix issues with nested gradients in html renderer. (flutter/engine#31887) * fb0fd74 Update the magic number for JPEG to just FF D8 FF. (flutter/engine#32076) * 233c17c Wrap the global timeline event handler callback in a std::atomic (flutter/engine#32073) * dfde2aa Roll Dart SDK from 24bf86f16411 to 5bc905e69609 (9 revisions) (flutter/engine#32075)
And besides I found the following issue is related to TextField focus:
This commit resolves iOS virtual keyboard glitch and TextField focus issue in Safari. When tapping the done button above the keyboard, TextField blurs and closes the keyboard right away instead of refocusing and reopening afterward.
Pre-launch Checklist
writing and running engine tests.
///
).