Keep input accessory view at bottom of screen when keyboard dismissed #2848
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.
https://phabricator.wikimedia.org/T213450
In this case keyboard dismissal occurs when the editor web view resigns 1st responder.
When this happens the system goes up the responder chain looking for a
UIResponder
subclass which wants to become 1st responder.Making
SectionEditorViewController
able to become 1st responder means it's the first such item in the responder chain encountered when the keyboard is dismissed.Making its
inputAccessoryView
returninputViewsController.inputAccessoryView
means the accessory view shown will be the one which was previously shown atop the keyboard.Looking at how find in page docks its accessory view at bottom when keyboard hidden was helpful:
#794 (comment)
#794 (comment)
#794 (comment)
These were useful too:
https://robots.thoughtbot.com/input-accessorizing-uiviewcontroller
https://developer.apple.com/documentation/uikit/uiresponder/1621119-inputaccessoryview
Question for @carolynlimadeo - this fix doesn't yet keep
Style
orTextFormatting
header from completely disappearing as seen below. It's pretty easy to fix (just need to move these headers in their owninputAccessoryView's
too) but wanted to double-check you wanted that 1st.