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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InputAccessoryView] Can't specify keyboard-conditional bottom padding #20157

Open
Ashoat opened this issue Jul 11, 2018 · 21 comments
Open

[InputAccessoryView] Can't specify keyboard-conditional bottom padding #20157

Ashoat opened this issue Jul 11, 2018 · 21 comments
Labels
Bug Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. 📮Known Issues This indicates an issue that refers to a bug or limitation of RN that is not currently being handled

Comments

@Ashoat
Copy link
Contributor

Ashoat commented Jul 11, 2018

Environment

React Native Environment Info:
  System:
    OS: macOS High Sierra 10.13.5
    CPU: x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 25.07 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 9.3.0 - ~/.nvm/versions/node/v9.3.0/bin/node
    Yarn: 1.6.0 - /usr/local/bin/yarn
    npm: 6.1.0 - ~/.nvm/versions/node/v9.3.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
    Android SDK:
      Build Tools: 23.0.1, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3
      API Levels: 23, 25, 26
  IDEs:
    Android Studio: 3.1 AI-173.4819257
    Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.4.1 => 16.4.1
    react-native: ^0.56.0 => 0.56.0

Description

If you have a bottom tab bar, you want the InputAccessoryView to appear above it when the keyboard is collapsed. However, when the keyboard is expanded, you want the InputAccessoryView to appear directly above the keyboard.

This sort of "conditional" bottom padding is currently impossible with InputAccessoryView. It seems that when the keyboard is expanded, the distance between the bottom of the screen and the InputAccessoryView is fixed. Attempting to change this distance with height, padding, or margin style properties does not seem possible.

Reproducible Demo

I've created a minimal repro here.

@kelset kelset added the Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. label Jul 13, 2018
@kelset kelset added the 📮Known Issues This indicates an issue that refers to a bug or limitation of RN that is not currently being handled label Sep 17, 2018
@stale
Copy link

stale bot commented Dec 16, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 16, 2018
@Ashoat Ashoat removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 16, 2018
@hramos hramos removed the Bug Report label Feb 6, 2019
@jakebloom
Copy link

@cpojer What is the status on this? Does the linked issue being closed indicate that this has been resolved?

@cpojer
Copy link
Contributor

cpojer commented Mar 25, 2019

No, it seems like this issue still exists. Please feel free to send a Pull Request with a fix.

@digitalbreed
Copy link

Until there is a fix, is there any workaround?

@stale
Copy link

stale bot commented Aug 4, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 4, 2019
@Ashoat Ashoat removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 4, 2019
@darrylyoung
Copy link

I'm also looking for a solution to this problem. I want an input and button sat at the bottom of my screen (on top of the tab bar) and when the input is in focus, the keyboard slides up and those elements slide up with it. The focused position works as expected but when the keyboard is collapsed, the input and button completely cover the tab bar.

Are there any workarounds for this while we're hoping for a proper solution? Did you have any luck, @digitalbreed / @Ashoat?

@Ashoat
Copy link
Contributor Author

Ashoat commented Sep 23, 2019

No, no solutions exist to my knowledge. You can avoid using KeyboardAccessoryView altogether, but that means you can’t pan the keyboard up/down... just press to open/close.

I’ve seen this non-React-Native solution, but it seems hard to port to React Native, and feels a little hacky.

@stale
Copy link

stale bot commented Dec 22, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 22, 2019
@Ashoat Ashoat removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 22, 2019
@stale
Copy link

stale bot commented Mar 21, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 21, 2020
@Ashoat Ashoat removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 21, 2020
@stale
Copy link

stale bot commented Jun 20, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 20, 2020
@Ashoat Ashoat removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 20, 2020
@stale
Copy link

stale bot commented Sep 20, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 20, 2020
@Ashoat Ashoat removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 20, 2020
@jamesxabregas
Copy link

I can confirm that this is still technically a current bug in React Native 0.63.3 and iOS 14.1. However after much consideration of this issue I have come to the conclusion that fixing this issue would like not provide a desierable UX design in most cases anyway. My app also uses a bottom tab bar, but after mocking out what my UI would like like with a bottom tab bar, open keryboard, and an InputAccessory I realised it would actually look very weird. In fact I looked through a number of popular apps that leverage an InputAccessoryView, (Facebook's create post screen is a common one) and in every case the screen that uses the InputAccessoryView is always a modal view that displays over the entire screen and hides the bottom tab bar. I assume that this is likely because displaying a bottom tab bar and an input accessory provides for a very confusing and clunky user expereince.

@gitVera
Copy link

gitVera commented Feb 2, 2022

https://reactnative.dev/docs/keyboard
you can add listeners and hide tabbar if keyboard is active

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 3, 2023
@Ashoat
Copy link
Contributor Author

Ashoat commented Mar 3, 2023

Not stale

@github-actions github-actions bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 4, 2023
@lucianobracco-geojam
Copy link

Still happening

@MarcusDelvecchio
Copy link

Still having issues with this

@kirillzyusko
Copy link
Contributor

@Ashoat Maybe it's doable with https://github.com/kirillzyusko/react-native-keyboard-controller and KeyboardStickyView component?

You can specify offset property for closed/opened state and it should work as expected 👀 It also support interactive keyboard dismissal so I think worth to try it out!

@Ashoat
Copy link
Contributor Author

Ashoat commented Jan 11, 2024

Looks super cool!! Will take a look at it when I get a chance. Thanks for sharing @kirillzyusko!

@mozzius
Copy link

mozzius commented May 4, 2024

This has the downside of not supporting interactive dismissal starting at the component, see the issue here: kirillzyusko/react-native-keyboard-controller#250

As it stands, you need to choose between having interactive dismiss or being able to set the position of the inputaccessoryview

@kirillzyusko
Copy link
Contributor

This has the downside of not supporting interactive dismissal starting at the component, see the issue here: kirillzyusko/react-native-keyboard-controller#250

As it stands, you need to choose between having interactive dismiss or being able to set the position of the inputaccessoryview

Yeah, I'm planning to fix this problem in the near future 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. 📮Known Issues This indicates an issue that refers to a bug or limitation of RN that is not currently being handled
Projects
None yet
Development

No branches or pull requests