-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
InputAccessoryView
like component, that's supports interactive dismissal beginning from the component, not the keyboard
#250
Comments
@kirillzyusko Do you have any idea how that could be implemented? Willing to contribute, but first wanted to double check with you 😊 |
(A solution that would work equally on android would be dope) |
Hello @hannojg As I can understand such offset/additional space could be achieved only if real I think me and @hirbod were trying to add In the past I did some experiments with attaching fake Regarding Android side - everything is much simpler there, because we have a full control over keyboard positioning. I think new prop like Maybe you have any ideas about how iOS can be implemented? BTW thank you for raising this issue 🙌 I also wanted to create/report it but didn't have time for that 😓 |
Funny, we just had this conversation last week. We tried many things, but I couldn't achieve the desired behavior with a hidden InputAccessoryView. To be fair, I didn't test it for more than an hour. |
I still didn't have time to work on this feature yet, but I found this interesting stuff: https://github.com/iAmrMohamed/AMKeyboardFrameTracker/blob/master/AMKeyboardFrameTracker/Classes/AMKeyboardFrameTracker.swift Basically this project is using similar technique to what is used in RNKC (KVO observer), but it seems like it supports custom height. Need to check implementation more carefully and add something similar to RNKC 👀 |
## 📜 Description Added `offset` property for `KeyboardGestureArea` component. ## 💡 Motivation and Context Add requested changes in #250 only on Android (for now). Later on I'll try to add similar functionality to iOS. On Android such functionality can be easily implemented, because we have a full control over the keyboard position - so we just need to take an additional variable in math calculations and that's all 😎 I am still not sure if adding negative number to the linear interpolator should change the behavior of linear interpolator - it's open question and I can fix it later on. Right now I'm happy to have such changes, because it definitely improves UX so ## 📢 Changelog <!-- High level overview of important changes --> <!-- For example: fixed status bar manipulation; added new types declarations; --> <!-- If your changes don't affect one of platform/language below - then remove this platform/language --> ### Docs - added info about `offset` property; ### JS - update `KeyboardGestureArea` spec; - update `types.ts` to include `offset` property for `KeyboardGestureArea`; ### Android - added setter for new `offset` property; - added new param to interpolator interface; ## 🤔 How Has This Been Tested? Tested manually on Pixel 7 Pro (API 34). ## 📸 Screenshots (if appropriate): |Before|After| |-------|-----| |<video src="https://github.com/user-attachments/assets/ba8fb69b-0c59-4ad0-a123-cc187c1e516d">|<video src="https://github.com/user-attachments/assets/f3a7bb61-b0d0-406a-b3ca-02502dd8a78e">| ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
Is your feature request related to a problem? Please describe.
(I am not sure whether this is a bug, or rather a feature request, so sorry if I picked the wrong template).
I am using this library to get interactive keyboard dismissal working. I then have a component that I render on top of the keyboard, which creates a similar effect to the
InputAccessoryView
.However, with the
InputAccessoryView
the dismissal starts as soon as your finger crosses the top/start of the view that's rendered above the keyboard.Running the example app I can see that it only dismisses once you draw the keyboard down:
Screen.Recording.2023-09-28.at.12.16.20.mov
Describe the solution you'd like
In this example I used a ScrollView with an
InputAccessoryView
. You can see how it starts dismissing the keyboard as soon as you reach the start of the accessory view:Screen.Recording.2023-09-28.at.12.25.32.mov
https://snack.expo.dev/@hannojg_margelo/vengeful-violet-strawberries?platform=ios
Describe alternatives you've considered
Not sure if this really needs a separate view, or maybe just some props that you can set to alternate the height from when it starts to pick up the dismiss gesture?
Additional context
/
The text was updated successfully, but these errors were encountered: