-
Notifications
You must be signed in to change notification settings - Fork 6k
End composing when inserting text #24866
Conversation
|
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. |
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! You're correct; insertText should bail us out of composing mode, but we should call [self unmarkText] here I think.
There are additional followups we'll need to add when we get to working with NSTextInputContext more (e.g. invalidateCharacterCoordinates) in this location too
| _activeModel->AddText([string UTF8String]); | ||
| if (_activeModel->composing()) { | ||
| _activeModel->CommitComposing(); | ||
| _activeModel->EndComposing(); |
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 believe we may need a [self unmarkText] call as well to let macOS know to bail out of composing mode on its end as well.
flutter/flutter#77544
As far as I can tell there other notification from AppKit that would inform us that composing is done. Without this flutter gets stuck in composing mode.
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.