Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support formSheet modal and floating keyboard #43

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

toshi0383
Copy link

@toshi0383 toshi0383 commented Oct 28, 2022

fixes: #33
fixes: #37

It turns out that formSheet automatically adjusts its position when keyboard is shown.
So I needed to fallback to use keyboardDidChangeFrameNotification instead of keyboardWillChangeFrameNotification in this use case.
This causes animation delay, but otherwise I couldn't calculate correct keyboardHeight inside formSheet.

kblayout-formsheet.mp4

Usage is simple enough.
Just set Keyboard.shared.presentedViewController when you know what you're doing.

Keyboard.shared.presentedViewController = self
vStack.bottomAnchor.constraint(lessThanOrEqualTo: view.keyboardLayoutGuideNoSafeArea.topAnchor).isActive = true

@toshi0383 toshi0383 marked this pull request as draft October 28, 2022 00:46
@toshi0383 toshi0383 marked this pull request as ready for review October 28, 2022 00:50
@toshi0383 toshi0383 changed the title fix: support formSheet modal use case fix: support formSheet modal and floating keyboard Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant