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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: better sticky view keyboard interpolation #397

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arekkubaczkowski
Copy link

@arekkubaczkowski arekkubaczkowski commented Mar 21, 2024

馃摐 Description

The element rendered within StickyView doesn't follow the keyboard and there appears a gap between.
This PR changes the way how sticky element position is being calculated.

馃挕 Motivation and Context

馃摙 Changelog

JS

  • replace interpolate with clamp method that calculates the exact position followed by keyboard

馃 How Has This Been Tested?

Tested in the project where this error occurs.

after.mov
before.mov

馃摑 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko self-assigned this Mar 21, 2024
@kirillzyusko kirillzyusko added the 馃摎 components Anything related to the exported components of this library label Mar 21, 2024
@kirillzyusko
Copy link
Owner

Hey @arekkubaczkowski

This code introduces breaking changes which I'd like to avoid:

Old New
image image

If we are using negative offset for closed, then it'll be ignored 馃様

Maybe we can add a new property, like ignoreHeightBelow and use interpolation like:

interpolate(height.value, [0, ignoreHeightBelow, height.value], [closed, closed, opened])

Will it work for you?

@arekkubaczkowski
Copy link
Author

@kirillzyusko Nice spot, I had to miss that. Yeah, having an option to toggle those two behaviours makes sense for me! will push the changes later on.

@kirillzyusko kirillzyusko added the KeyboardStickyView 馃┕ Anything related to KeyboardStickyView component label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃摎 components Anything related to the exported components of this library KeyboardStickyView 馃┕ Anything related to KeyboardStickyView component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants