-
Notifications
You must be signed in to change notification settings - Fork 6k
[iOS] Remove selectionDidChange call in UndoManager #45657
[iOS] Remove selectionDidChange call in UndoManager #45657
Conversation
|
/cc @fbcouch fyi |
Could you explain more about this? Did you see a bar showing up and immediately dismissed? |
| } | ||
|
|
||
| if (_viewController.engine.textInputPlugin.textInputView != nil) { | ||
| // This is needed to notify the iPadOS keyboard that it needs to update the |
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.
is this comment still relevant?
| _viewController.engine.textInputPlugin.textInputView.inputAssistantItem; | ||
| NSArray<UIBarButtonItemGroup*>* leadingGroups = assistantItem.leadingBarButtonGroups; | ||
| assistantItem.leadingBarButtonGroups = @[]; | ||
| assistantItem.leadingBarButtonGroups = leadingGroups; |
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.
hy is it setting leadingBarButtonGroups to empty array, and then setting back to the original value? Adding some comments here will be helpful.
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.
This was a workaround to notify the iPadOS keyboard to update the state of these buttons. It's been awhile, but I believe the behavior I was seeing was that state changes to canUndo/canRedo would not show up until the next keypress – so if I press a letter, the undo button should light up, but it won't until I press another key.
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.
Worth trying if it works if we simply do assistantItem.leandingBarButtonGroups = assistantItem.leandingBarButtonGroups, in case apple doesn't check for no-ops in the setter.
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.
BTW if it's iOS 17 related, feel free to contribute to the design doc which already discusses about several iOS 17 text input issues. It can be a good reference doc for future developers.
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 original issue is reproduced on an iOS 16 device so probably not ios specific.
I tested removing the intermediate empty array step it appears the setter indeed doesn't skip even when given the same array instance. Updated. I'll file a radar later since the keyboard could just rely on notifications to properly update the undo/redo UI.
hellohuanlin
left a comment
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. thanks for the update.
8333758 to
d9da08f
Compare
…134998) flutter/engine@e1c784e...589bde9 2023-09-19 [email protected] Roll Skia from 4122791099ce to 744807d740c7 (1 revision) (flutter/engine#46019) 2023-09-19 [email protected] [Android] Add support for setting thread affinity based on core speed. (flutter/engine#45673) 2023-09-19 [email protected] [Impeller] Fix STB backend to account for max texture sizes. (flutter/engine#46010) 2023-09-19 [email protected] [Impeller] Hold the CommandPoolVK at a higher scope. (flutter/engine#46013) 2023-09-19 [email protected] Roll Skia from 0c990ab9e097 to 4122791099ce (19 revisions) (flutter/engine#46016) 2023-09-18 [email protected] Add missing include of SkPath (flutter/engine#45996) 2023-09-18 [email protected] [Impeller] Respect max supported texture size when allocating glyph atlas texture. (flutter/engine#45992) 2023-09-18 [email protected] Roll Fuchsia Mac SDK from 3_Lh8otTpmVuf-Zwb... to qy5FU4y6sx1FscCpd... (flutter/engine#45998) 2023-09-18 [email protected] Revert "[Windows] Update vsync on raster thread (#45310)" (flutter/engine#46000) 2023-09-18 [email protected] Provide a default `--target-variant` for `clang_tidy`. (flutter/engine#45909) 2023-09-18 [email protected] Revert "[ios] use python script to generate extension safe frameworks and code sign them" (flutter/engine#46004) 2023-09-18 [email protected] Disable HardwareBuffer backed Platform Views temporarily (flutter/engine#45986) 2023-09-18 [email protected] Tighten up ImageReaderPlatformViewRenderTarget code (flutter/engine#45889) 2023-09-18 [email protected] [ios] use python script to generate extension safe frameworks and code sign them (flutter/engine#45781) 2023-09-18 [email protected] Bump impeller-cmake to HEAD. (flutter/engine#45953) 2023-09-18 [email protected] [iOS] Remove selectionDidChange call in UndoManager (flutter/engine#45657) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from 3_Lh8otTpmVu to qy5FU4y6sx1F If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#134998) flutter/engine@e1c784e...589bde9 2023-09-19 [email protected] Roll Skia from 4122791099ce to 744807d740c7 (1 revision) (flutter/engine#46019) 2023-09-19 [email protected] [Android] Add support for setting thread affinity based on core speed. (flutter/engine#45673) 2023-09-19 [email protected] [Impeller] Fix STB backend to account for max texture sizes. (flutter/engine#46010) 2023-09-19 [email protected] [Impeller] Hold the CommandPoolVK at a higher scope. (flutter/engine#46013) 2023-09-19 [email protected] Roll Skia from 0c990ab9e097 to 4122791099ce (19 revisions) (flutter/engine#46016) 2023-09-18 [email protected] Add missing include of SkPath (flutter/engine#45996) 2023-09-18 [email protected] [Impeller] Respect max supported texture size when allocating glyph atlas texture. (flutter/engine#45992) 2023-09-18 [email protected] Roll Fuchsia Mac SDK from 3_Lh8otTpmVuf-Zwb... to qy5FU4y6sx1FscCpd... (flutter/engine#45998) 2023-09-18 [email protected] Revert "[Windows] Update vsync on raster thread (flutter#45310)" (flutter/engine#46000) 2023-09-18 [email protected] Provide a default `--target-variant` for `clang_tidy`. (flutter/engine#45909) 2023-09-18 [email protected] Revert "[ios] use python script to generate extension safe frameworks and code sign them" (flutter/engine#46004) 2023-09-18 [email protected] Disable HardwareBuffer backed Platform Views temporarily (flutter/engine#45986) 2023-09-18 [email protected] Tighten up ImageReaderPlatformViewRenderTarget code (flutter/engine#45889) 2023-09-18 [email protected] [ios] use python script to generate extension safe frameworks and code sign them (flutter/engine#45781) 2023-09-18 [email protected] Bump impeller-cmake to HEAD. (flutter/engine#45953) 2023-09-18 [email protected] [iOS] Remove selectionDidChange call in UndoManager (flutter/engine#45657) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from 3_Lh8otTpmVu to qy5FU4y6sx1F If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Fixes flutter/flutter#133424 The `-[TextInputDelegate selectionDidChange:]` call actually triggers some unwanted keyboard NLP actions that generate a bunch of candidates and automatically accept the first candidate. This causes `-[UITextInput setMarkedText:selection]` to be called with the first candidate and that inserts extraneous characters after the user types certain characters on the iPad software keyboard. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Fixes flutter/flutter#133424
The
-[TextInputDelegate selectionDidChange:]call actually triggers some unwanted keyboard NLP actions that generate a bunch of candidates and automatically accept the first candidate. This causes-[UITextInput setMarkedText:selection]to be called with the first candidate and that inserts extraneous characters after the user types certain characters on the iPad software keyboard.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.