douglasjunior / react-native-keyboard-manager

⚛ Library to prevent issues of keyboard sliding up and cover inputs on React-Native iOS projects.
https://www.npmjs.com/package/react-native-keyboard-manager
MIT License
962 stars 60 forks source link

Toolbar disappears when typing? #3

Closed joncursi closed 7 years ago

joncursi commented 7 years ago

out

NicholasBertazzon commented 7 years ago

Same here.

douglasjunior commented 7 years ago

I'll take a look, sorry for the delay guys, I'm very busy.

douglasjunior commented 7 years ago

I did a test and the sample project works correctly. Maybe it's something with TextInput you're using.

Could you give me more details about your component and layout, or even create a small example project?

NicholasBertazzon commented 7 years ago

I don't have anything special, I've just installed it and imported the keyboardmanager (import KeyboardManager from 'react-native-keyboard-manager') for set the text on the done button (KeyboardManager.setToolbarDoneBarButtonItemText(actual_language.translator.button_done);)

Anyway, I think it's the latest iOS update, it worked well before. Tested with an outdated version of iOS 10 and it works.

douglasjunior commented 7 years ago

The most recent iOS version you say is 11? I tested it on version 10.3.1.

teste

bestv2 commented 7 years ago

same here with ios 8.3,10.3.1 and 10.3.3 image image

douglasjunior commented 7 years ago

I think it's something with Input that you're using. Without a project in hand I cant see the problem :(

pcfutures commented 7 years ago

I'm getting this problem, you can see the file where it's happening is here.

Any solution would be appreciated!

NicholasBertazzon commented 7 years ago

Hey @douglasjunior , I think it's related to the latest (0.47) react-native update.

douglasjunior commented 7 years ago

@NicholasBertazzon thanks, I'll take a look this week.

douglasjunior commented 7 years ago

I was able to reproduce the problem by updating React Native from 0.45.1 to 0.47.2. But I have not found the cause yet.

If anyone can help investigate what has changed in React Native I will appreciate.

NicholasBertazzon commented 7 years ago

Maybe https://github.com/facebook/react-native/commit/2b1795c5add2e1442878a884d6dcd8f0ec5c1572 , or not, a lot of things have changed regarding textinput

pcfutures commented 7 years ago

Maybe something to do with these? I'm no good at native so I don't really know, but it sounds related. https://github.com/facebook/react-native/commit/3364488af062ddfbe439fd2d364ae21ff0f662eb https://github.com/facebook/react-native/commit/a8c45ac1c38866df222434b2d99d2a18b908c45f

douglasjunior commented 7 years ago

@NicholasBertazzon bingo! The problem has introduced in https://github.com/facebook/react-native/commit/2b1795c5add2e1442878a884d6dcd8f0ec5c1572

I just commented the lines where the value of the textInputView.inputAccessoryView is set, and the problem is gone.

I'll investigate with the author of IQKeyboardManager if there is anything we can do.

douglasjunior commented 7 years ago

As we know this problem start in version 0.47.0 of React Native. So, I plan to send a PR soon. In the meantime, you can use this temporary hack.

Just comment this line:

captura de tela 2017-09-22 as 20 19 47

ivanzotov commented 7 years ago

@douglasjunior thanks, it works. And thanks for the great library 👍

douglasjunior commented 7 years ago

Guys, I'd like to invite you to follow the discussion about this problem https://github.com/facebook/react-native/issues/16071. What is your opinion?

JayHuang commented 7 years ago

Quite disappointed about this breaking change, to be honest. Our application requires us to use a custom inputAccessoryView, and up till recently, we accomplished this through creating .patch files off of RNText. These patches no longer worked because RNText had an overhaul after RN v0.44, and we've been hoping to use a more holistic solution like react-native-keyboard-manager instead.

The implications of this means we are once again back at square one with all this, with no guarantee that we will not end up in this situation once again in the near future, nevermind all the bugfixes libraries like react-native-keyboard-manager have to offer.

I have little doubt in my mind that many others are stuck in a similar bind, and it does not seem like RN offers any feasible alternative in the meantime.

joncursi commented 7 years ago

@JayHuang I'm right there with you!

douglasjunior commented 7 years ago

I found this issue https://github.com/facebook/react-native/issues/371 where several devs share the same situation.

douglasjunior commented 7 years ago

I think I found a temporary solution, using the worst ant-pattern of objective-c: the extensions. Please try again with version 4.0.13-2.

joncursi commented 7 years ago

The latest version breaks my build:

screen shot 2017-10-04 at 10 16 46 pm

douglasjunior commented 7 years ago

What is your react-native version? Can you run the Sample project in your environment?

joncursi commented 7 years ago

I tried last night on 0.48.4, and I just upgraded to 0.49.1 and still the same issue. I've cleared out my Derived Data and cleaned the XCode project, and that's when this build error came up (I had it initially working on cached data).

EDIT: After restarting XCode (I'm on XCode 9), it did build properly. I think XCode has it's own cache layer!

douglasjunior commented 7 years ago

I also had something like that in the first time that I tried to create the extension. But then it worked and I could not be sure if it was a cache problem.

joncursi commented 7 years ago

This build error keeps coming up for me every time I re-install my node_modules.

douglasjunior commented 7 years ago

Unfortunately there is not much to do. I dont understand why Xcode has difficulty to find this import.

douglasjunior commented 7 years ago

@joncursi please, try with this version:

npm install --save react-native-keyboard-manager@git+https://github.com/douglasjunior/react-native-keyboard-manager.git#search-path