Skip to content

Conversation

mikhailChelbaev
Copy link
Collaborator

@mikhailChelbaev mikhailChelbaev commented Jan 2, 2025

as per title + change content alignment in SUModal to center

in SUModal keyboard works fine by default

to test this PR, you can use UKTextInput in modal's body in previews

@mikhailChelbaev mikhailChelbaev self-assigned this Jan 2, 2025
if let keyboardHeight = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.height {
let duration = notification.userInfo?[UIResponder.keyboardAnimationDurationUserInfoKey] as? CGFloat ?? 0.25
UIView.animate(withDuration: duration) {
self.contentViewBottomConstraint?.constant = -keyboardHeight - self.model.contentPaddings.bottom + self.view.safeAreaInsets.bottom
Copy link
Collaborator Author

@mikhailChelbaev mikhailChelbaev Jan 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keybardHeight contains bottom safe area inset + this is a safe area constraint, so bottom safe area inset value should be added back, otherwise it will be counted twice

@mikhailChelbaev mikhailChelbaev merged commit 0f7fd23 into dev Jan 2, 2025
1 check passed
@mikhailChelbaev mikhailChelbaev deleted the fix/modal-keyboard-interaction branch January 2, 2025 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant