feat: insets prop for KeyboardToolbar#866
Merged
kirillzyusko merged 1 commit intomainfrom Mar 18, 2025
Merged
Conversation
Contributor
📊 Package size report
|
Contributor
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
9c22330 to
b36a7f2
Compare
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.
📜 Description
Handle safe-area paddings in
KeyboardToolbarcomponent (landscape mode).💡 Motivation and Context
I had a lot of ideas how to fix this problem. Some of them:
insetsas prop;useSafeAreaInsetshook;The automatically grab insets from
useSafeAreaInsetshook idea has failed, because in my casereact-native-safe-area-contextwas resolving to other packages (maybe it's the problem with package linking in example app). But this is still not a perfect approach, because I'll force users to install additional package.The render view wrapper (users can add their own SafeAreaView implementation) was perspective, but it would be very complex for end users. Mostly because we have to provide additional props, such as
backgroundColoretc., so it would look like:And there is still a lot of open topics on how to handle many aspects - we would have to write conditional code when wrapper is not provided and render
View.So in the end I decided to add
insetsproperty - and it would be up to lib users to provide it or not. Maybe not ideal solution, but definitely better than having an open issues for 9+ months 🙃Closes #572
📢 Changelog
JS
insetsproperty.🤔 How Has This Been Tested?
Tested manually on iPhone 15 (iOS 17.5), Fabric.
📸 Screenshots (if appropriate):
📝 Checklist