fix(ios): expose keyboard animation params as CSS custom properties#56
Open
real-alexei wants to merge 2 commits intoionic-team:mainfrom
Open
fix(ios): expose keyboard animation params as CSS custom properties#56real-alexei wants to merge 2 commits intoionic-team:mainfrom
real-alexei wants to merge 2 commits intoionic-team:mainfrom
Conversation
Set --keyboard-height, --keyboard-animation-duration, and --keyboard-animation-curve CSS variables on document.body, enabling web content to animate in sync with the iOS keyboard. Removes the artificial 0.2s delay previously added to the animation duration.
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.
fix(ios): expose keyboard animation params as CSS custom properties
Set
--keyboard-height,--keyboard-animation-duration, and--keyboard-animation-curveCSS variables ondocument.body, enabling web content to animate in sync with the iOS keyboard. Removes the artificial 0.2s delay previously added to the animation duration.Change Type
Rationale / Problems Fixed
Currently there is no way for web content to synchronize its own animations with the native iOS keyboard animation. The plugin applies a hardcoded 0.2s artificial delay to
setKeyboardHeight, which doesn't match the actual system animation timing.This PR exposes the native keyboard animation parameters (duration, curve, and height) as CSS custom properties so web developers can use them in CSS transitions/animations to stay perfectly in sync with the keyboard:
--keyboard-height— updated in real time as the keyboard appears/resizes--keyboard-animation-duration— the system-reported animation duration--keyboard-animation-curve— mapped to a CSS timing function (ease-in-out,ease-in,ease-out,linear)Tests or Reproductions
Tested on an iOS device by observing that CSS transitions using the exposed custom properties animate in sync with the keyboard show/hide.
Platforms Affected
Notes / Comments
The artificial +0.2s delay on the animation duration has been removed as it is no longer needed — the real system duration is now passed through directly.