-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[TextInput] Supply access to UITextView.inputAccessoryView attribute on <TextInput /> #371
Comments
Yes definitely - this is how we built parts of the comment input in the Groups app. Hopefully we'll be able to clean it up soon and release it to you guys. |
@sahrens do you have code you could throw over the wall that I could take a pass at cleaning up? |
@sahrens - this would be great to see, this seems to be a highly requested feature |
I'll take a look at what we have.
|
+1 for solving this |
Not yet, but would be a good idea to get back on this... |
I have an initial implementation in progress that is not quite ready yet. When I get it working, I'll gist it. I'm currently working on it as a component (outside of the main repo), but will plan on making it a pull req when it is functional. Also... the API might need some help... |
+1 |
2 similar comments
+1 |
+1 |
Sounds great, @auser - looking forward to that PR ;) |
I've been playing around with tying an inputAccessoryView with RN. One thing I immediately noticed is that when using the navigator component, keyboard dismissal isn't as clean as with UINavigationController. An example of the regular behavior: Notice how the keyboard slides away in tandem with the view as the controller is popped? Using the navigator component, there's no direct correlation and so the keyboard stays in place (or slides downward if you preemptively dismiss). The reason why I bring this up is because when using an InputAccessoryView, this difference becomes much more amplified, because the content of the view is usually much more scene-specific than the generic keyboard. Any suggestions? I looked all over the groups app, and couldn't find a place where the navigation slides in a way that would reveal this issue. |
cc @ericvicenti @hedgerwang @ide - interesting point raised above by @sjmueller also cc @boourns - maybe your team could look at this too :) |
Great point and quite tricky I believe. Since we don't want to use UINavigationController and UIViewController we're going to need to move the keyboard ourselves. Should be possible by getting the UIWindow that contains the keyboard and applying a transform to it. Certainly yet another thing to consider for Navigator scenes. |
Yeah, messy. Native animations won't handle this any time soon. Might be
|
We have an inputAccessoryView prototype internally that would solve this problem, but there were some concerns about performance that have stopped us from shipping it. I'll see if we can revisit that. |
@nicklockwood, curious what approach is used with the fb prototype? Like @ide says, there's no UINavigationController and UIViewController with the Navigator component, so it'd be interesting to learn about the way you're currently solving the challenge. |
If it's easier to make it work with NavigatorIOS then let's have that first, please. It's a show stopper in apps that take numeric input for the user not to be able to signal "done" explicitly. +1 Update: |
@idibidiart Can you share your solution? Is that a pure-JS solution or a UIInputAccessory? Update to my work: lost my uncommitted code in a (unfortunate) reformat of a faulty OS. |
@auser not sure how far along you were from this gist: https://gist.github.com/auser/38d7484d986ab911152c#file-UIViewController+InputAccessory-m |
@auser sorry didn't see your messsage. I'm just browsing this thread again. Mine is a simple JS based solution that is based on DeviceEmitter/KeyboardWillShow event and a simple ankmation of a "Done" button view that is initially hidden below the screen and is then animated up to coincide with the keyboards own animation. I just saw the native solution by @sjmeuller and I'm wondering if something like this can make it into the next version of React Native @nicklockwood @ide |
@sjmueller I forgot I posted that! Thanks for the reminder. That was the beginning of my work. The issue with that code, as of then was that I wanted to design it with the native 'View' library. With that implementation, it doesn't quite work yet. Was talking with @ide to understand that. Perhaps he has an idea with the release of 0.11.x. That was on 0.5.0. Anyway, I can get back to work on it. Thanks for the reminder. |
+1 👍 |
👍 |
+1 Is there any update on this? Maybe an updated gist that we could leverage locally in the meantime? |
+1 |
1 similar comment
+1 |
UPDATE: 30/01/2018 Using Obj-c extensions I founded a way to make the react-native-keyboard-manager works again. Any news on this? Until version 0.46.4 was possible to access the We are discussing this on douglasjunior/react-native-keyboard-manager#3 and #16071, but it seems that there is no interest on the part of the RN team. |
+1 |
+1 on this. |
why is this closed, there is no functionality for this on RN? What's more is that Android provides a 'done' or 'next' button on the numeric keyboard and iOS doesn't and it always breaks parity. |
+1 |
One solution is to use a native UI component using this guide :) I'll see if I can share some code or open source something. |
This package works for getting that nice swipe to close with the keyboard ( |
@PeteTheHeat is going to have an RN Core solution on iOS pretty soon! |
Hello! Thanks @sahrens! Any idea how soon? I've solved this by implementing a native textfield component and adding that functionality, but now I need to do that for a textarea as well so I'm wondering if I should just wait for a React Native solution. Thanks! |
Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version? I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer. |
Did this make it into 0.55? |
@loxtank yup https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#055. I'm still fixing some things with it. Feel free to open any issues you find. |
@PeteTheHeat thanks so much for working on this! There are several serious issues with the implementation as it stands:
Knowing FB culture around code ownership, I imagine you've probably moved on to something else. But if you have any spare cycles at all, would appreciate you looking into some of these issues. Any pointers on how to address them would be appreciated as well. |
I also think this issue is relevant: #27440 -> React native IOS InputAccessoryView disappear from the screen after close modal. Any help will be appreciated. |
It would be cool to have this to make sticky text inputs.
(t21661353)
The text was updated successfully, but these errors were encountered: