react-native-keyboard-manager icon indicating copy to clipboard operation
react-native-keyboard-manager copied to clipboard

Toolbar hides once I start Typing (both on simulator and physical device)

Open tomiwaajayi opened this issue 1 year ago • 7 comments

  • How did you link to the library (autolinking, manual, rn link, cocoapods)?
  • Autolinking
  • What version of React Native?
  • 0.74.2
  • What version of the library?
  • 6.5.16-0
  • iOS version?
  • 17.5.1
  • Did the problem happen after updating React Native?
  • Yes (upgrading to expo 51)
  • Are you using the library for the first time?
  • No
  • It's a bug? Provide a link to a minimal reproduction case.

https://github.com/douglasjunior/react-native-keyboard-manager/assets/16718548/de12b51a-b936-4975-bb83-651711ba27f8

tomiwaajayi avatar Jun 26 '24 10:06 tomiwaajayi

You have upgraded from expo 50 to 51? On version 50 was working fine?

Please, provide the configuration used in the KeyboardManager.

douglasjunior avatar Jun 26 '24 11:06 douglasjunior

Hi @douglasjunior Yes it was working fine on Version 50.

Her's the config I used

if (Platform.OS === 'ios') {
 KeyboardManager.setEnable(true)
 KeyboardManager.setEnableDebugging(true)
 KeyboardManager.setKeyboardDistanceFromTextField(30)
 KeyboardManager.setLayoutIfNeededOnUpdate(true)
 KeyboardManager.setEnableAutoToolbar(true)
 KeyboardManager.setToolbarDoneBarButtonItemText('Done')
 KeyboardManager.setToolbarManageBehaviourBy('subviews') // "subviews" | "tag" | "position"
 KeyboardManager.setToolbarPreviousNextButtonEnable(true)
 KeyboardManager.setToolbarTintColor('#2C67F6') // Only #000000 format is supported
 KeyboardManager.setToolbarBarTintColor('#f6f6f6') // Only #000000 format is supported
 KeyboardManager.setShouldShowToolbarPlaceholder(false)
 KeyboardManager.setOverrideKeyboardAppearance(false)
 KeyboardManager.setKeyboardAppearance('default') // "default" | "light" | "dark"
 KeyboardManager.setShouldResignOnTouchOutside(true)
 KeyboardManager.setShouldPlayInputClicks(true)
}

I also tried using it without defining any config and it was the same.

tomiwaajayi avatar Jun 26 '24 12:06 tomiwaajayi

Same issue is on happening on "expo": "^52.0.9" also!

jayan2019 avatar Nov 21 '24 15:11 jayan2019

It happens because of this: https://github.com/facebook/react-native/pull/48339

Expo 52 enables new architecture by default, and that issue is present on new architecture only. As a potential workaround you have two options:

  • to patch RN with the changes from this PR
  • to disable new architecture (temporarily) and enable it again in future Expo SDK versions (with RN 0.78 probably, I'll try to create a cherry pick request for RN 0.77)

kirillzyusko avatar Dec 24 '24 10:12 kirillzyusko

Thank you @kirillzyusko, changes from your PR is fixed this issue! Here is the patch file if anyone would like to use! react-native+0.76.6.patch

jayan2019 avatar Jan 13 '25 11:01 jayan2019

@jayan2019 How to use this patch? I am using 0.76.7 version. Please help to fix this issue

sandeepsuthar avatar Feb 08 '25 04:02 sandeepsuthar

@jayan2019 How to use this patch? I am using 0.76.7 version. Please help to fix this issue

Hi @sandeepsuthar you need to install patch-package in your project.

  1. Install patch-package
  2. Configure based on patch-package
  3. Change the code in node_modules as in this PR from @kirillzyusko
  4. Run npx patch-package react-native

All are clearly explained in the patch-package Readme.md

jayan2019 avatar Feb 10 '25 08:02 jayan2019