-
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 inside View doesn't work #99
Comments
This is a known bug, if you change your css to something like: container: {
flex: 1,
top: 50,
borderWidth: 1,
borderColor: 'blue',
},
subc: {
borderWidth: 1,
borderColor: 'red',
}, You'll see that your |
If I understand this correctly, React Native is doing the right thing here.
|
I haven't used css-layout before. If child is relative to the parent element and there is no height specified to parent, does the parent element expand when top is specified to child or the child goes out of the parent element ? But, looks like it does come out of the parent container. I did a test with css-layout - https://github.com/boopathi/textinputbug/blob/master/css-style.js - and the result I got was this https://github.com/boopathi/textinputbug/blob/master/css-style.output.json . The So, I guess the fix for this would be to not style(top, etc...) the textinputs and manually add height to parent. |
I'm not sure, in plain css it wouldn't work, because you didn't set a The thing is that, in the HTML, even if you use /cc @nicklockwood that's the behavior I was trying to explain to you not so long ago. |
Seems likely it'd work by putting the
Yeah the combination of it being visible but untouchable sucks :( Maybe views should clip to bounds by default? |
This is the way iOS works and definitely feels wrong. I'd really like it to be fixed but I'm unsure if it's even possible. Would love some iOS experts to chime in |
@vjeux If we really want to make it work we're going to have to reimplement hitTest... |
So interestingly the work's already been done to support this. And indeed, if we use the original example in https://github.com/boopathi/textinputbug/blob/326362e5d39588682048bccda281d6bb2701d04a/index.ios.js with So making this "just work" seems to only be a matter of changing the default |
@joshaber Interesting... I hadn't seem it there lol Maybe for |
Yup, I think that makes sense 👍 |
@joshaber That works. Thanks! @tadeuzagallo 👍 |
Summary: - Returns matching subview hitTest or super hitTest if no match found. Should fix facebook#99 . Closes facebook#501 Github Author: Boopathi Rajaa <[email protected]> Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary: - Returns matching subview hitTest or super hitTest if no match found. Should fix facebook#99 . Closes facebook#501 Github Author: Boopathi Rajaa <[email protected]> Test Plan: Imported from GitHub, without a `Test Plan:` line.
Should the TextInput be working in iOS now? I am on 0.18.1 and TextInput is not visible on iOS, while working as expected on Android |
@latusaki that sounds like a different issue. The original reporter was complaining that a Can you provide an example demonstrating the problem that you're seeing? |
I have made a question on SO about this, http://stackoverflow.com/questions/35086827/reactnative-textinput-not-visible-ios, there I was told that |
Hmm, I'm not sure what the correct behavior should be, but it definitely shouldn't be different between platforms. @dmmiller, do you know which platform is behaving incorrectly here? |
@nicklockwood I think it should show on iOS. It probably ought to use defaults (like the line height of the font). It does show on Android and on the web with an tag without any size or style information. |
For people looking here for a solution, without understanding/going through someone's code:
Example:
|
I dont see the input text neither the border of the input box ? |
The sample project with this bug is here - https://github.com/boopathi/textinputbug
Am I doing something wrong here ?
The text was updated successfully, but these errors were encountered: