-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[iOS/TextInput] Impossibility to use inputAccessoryView
#16071
Comments
…n iOS Summary: Standard only-numeric (number pad) keyboard on iOS does not have any "Done" or "Enter" button, and this is often very badly hurt user experience. Usually it can be solved by implementing custom `inputAccessoryView`, but RN does not have built-in support for customizing it. So, this commit introduced limited support only for "Done" button (returnKeyType="done") and it should suite very well for the vast majority of use cases. This is highly requested feature, see more details here: #1190 Reviewed By: mmmulani Differential Revision: D5268020 fbshipit-source-id: 90bd5bffac6aaa1fb7c5c2ac539b35b04d45918f
I thought about this issue for awhile after it was reported as a commit comment. And I think that we should not fix this in RN. |
Sorry, I dont think that you understood the problem, and I dont think that issue should be closed.
There is no magic, what the library does is simple, and the library is not the focus of the problem here. In conclusion, I just want to be able to add my own |
Let me put it this way: It is RN's UITextView/UITextField instance, RNText lib owns this and controls it. If some another library access it directly and the result is undesirable, it should be fixed in that library. |
Forget the library, the question here is that I cant use my own Before using any library I, and several others developers, used an own I worked on this problem for a few days and could not find a solution. Because the RN overrides the I just want to make sure if you really understand the problem and are if you making the right decision. Everything would be resolved with an option to disable this new "feature". My suggestion is to create an option that will change this: - (void)didSetProps:(NSArray<NSString *> *)changedProps
{
[self invalidateInputAccessoryView];
} To something like this: - (void)didSetProps:(NSArray<NSString *> *)changedProps
{
if (automaticToolbarEnabled) {
[self invalidateInputAccessoryView];
}
} |
Okay, I will fix that, I think I know how to do it.
|
I really appreciate your help 🎉 . We love you too ❤️ . I have tried to solve this in several ways, but I could not. My temporary bad solution was to create an extension to override the Please, if you have any documentation that can help me to understand the flow of RN internal components, I can try to help you better in the next time. |
Summary: Now RCTTextInput relies on ivar to detect should it reconstruct inputAccessoryView or not. Previously we checked `inputAccessoryView` directly which breaks some 3rd party libs. See #16071 for more details. cc douglasjunior Reviewed By: javache Differential Revision: D5994798 fbshipit-source-id: c086efdd24f5528393a4c734ff7c984e0ed740d1
@douglasjunior bf36983 should fix your problem. |
Amazing, thank you @shergin. 🎉 |
I tested it with the |
@douglasjunior Can you elaborate on how you accessed inputAccessoryView? My project is currently dependent on react-native-textinput-utils and I would like to remove this dependency since the repo is extremely out of date. Did you go with the extension approach you mentioned above? |
@rplankenhorn checkout the react-native-keyboard-manager and IQKeyboardManager. |
Is this a bug report?
It is a incorrect behavior introduced in version
0.47.0
, commit 2b1795cThis commit brought a problem to those who use a custom ToolBar in TextInput, like IQKeyboardManager. And there is no option to disable this behavior.
Environment
Environment:
OS: macOS Sierra 10.12.6
Node: 6.11.0
Yarn: 1.0.2
npm: 5.4.2
Watchman: 4.9.0
Xcode: Xcode 9.0 Build version 9A235
Android Studio: EAP AI-171.4316950 AI-171.4316950
Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: 0.48.2 => 0.48.2
Steps to Reproduce
$ clone https://github.com/douglasjunior/react-native-inputAccessoryView.git
$ cd react-native-inputAccessoryView
$ yarn install
$ react-native run-ios
Expected Behavior
It is expected that when typing, the Toolbar will not disappear. As in
react-native 0.46.4
.Actual Behavior
When typing, the Toolbar disappears, because the
inputAccessoryView
is set tonull
.The text was updated successfully, but these errors were encountered: