Fix Gutenberg keyboard hide observer to handle dismissal notifications#25544
Merged
crazytonyli merged 2 commits intomokagio/swiftlint-unneeded-parens-closure-argfrom May 8, 2026
Merged
Conversation
2 tasks
Collaborator
Generated by 🚫 Danger |
Agent-Logs-Url: https://github.com/wordpress-mobile/WordPress-iOS/sessions/7c35862b-6e7d-4fd5-adde-7d42afde9eaa Co-authored-by: mokagio <1218433+mokagio@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [WIP] Address feedback on enabling SwiftLint rule: unneeded_parentheses_in_closure_argument
Fix Gutenberg keyboard hide observer to handle dismissal notifications
May 8, 2026
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 32179 | |
| Version | PR #25544 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 0cf5b6f | |
| Installation URL | 746qmu4rk8qbg |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 32179 | |
| Version | PR #25544 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 0cf5b6f | |
| Installation URL | 7282e8kbjtpd8 |
mokagio
reviewed
May 8, 2026
| } | ||
| } | ||
| keyboardHideObserver = NotificationCenter.default.addObserver(forName: UIResponder.keyboardDidShowNotification, object: nil, queue: .main) { [weak self] notification in | ||
| keyboardHideObserver = NotificationCenter.default.addObserver(forName: UIResponder.keyboardDidHideNotification, object: nil, queue: .main) { [weak self] notification in |
Contributor
There was a problem hiding this comment.
@crazytonyli @jkmassel this makes sense to me: The hide observer should subscribe to the hide notification. But you'll sure have more context on the choices of implementation.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes keyboard dismissal handling in the Gutenberg editor by correcting a miswired notification observer so constraint updates run when the keyboard actually hides.
Changes:
- Updated
keyboardHideObserverto subscribe toUIResponder.keyboardDidHideNotification(instead ofkeyboardDidShowNotification). - Restores the keyboard-dismiss path so
updateConstraintsToAvoidKeyboardis invoked on dismissal.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
crazytonyli
approved these changes
May 8, 2026
Contributor
crazytonyli
left a comment
There was a problem hiding this comment.
Looks like a copy-pasta error.
368e894
into
mokagio/swiftlint-unneeded-parens-closure-arg
28 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This stacked PR addresses feedback from the SwiftLint follow-up thread by fixing a pre-existing observer wiring bug in
GutenbergViewController. The hide observer was incorrectly subscribed to keyboard show notifications, preventing the hide path from running on keyboard dismissal.Observer wiring
keyboardHideObserverto subscribe toUIResponder.keyboardDidHideNotificationinstead ofUIResponder.keyboardDidShowNotification.Behavioral impact