Skip to content
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

FormInput with alignItems: 'center' #70

Closed
Cretezy opened this issue Oct 20, 2016 · 7 comments
Closed

FormInput with alignItems: 'center' #70

Cretezy opened this issue Oct 20, 2016 · 7 comments
Labels
Milestone

Comments

@Cretezy
Copy link

Cretezy commented Oct 20, 2016

When using a FormInput and flexbox with alignItems: 'center', the input does not render at all, even with width/height set. How would you go to about centering inputs?

@dabit3
Copy link
Collaborator

dabit3 commented Nov 7, 2016

Don't think this is possible. If you figure it out, feel free to submit a pr, thanks for the input.

@dabit3 dabit3 closed this as completed Nov 7, 2016
@vladra
Copy link

vladra commented Feb 12, 2017

@dabit3 Envountered exactly same issue. If I'm placing FromInput inside view with alignItems 'center', input is not rendered/visible. If I remove alignItems, it works fine.

Blank screen in this case:

  <View style={{ alignItems: 'center' }}>
    <FormInput />
  </View>

And I see input in this case:

  <View >
    <FormInput />
  </View>

@Cretezy Have you solved this?

@Monte9
Copy link
Collaborator

Monte9 commented Feb 12, 2017

@vladra any ideas on what might be causing it/possible fixes?

@vladra
Copy link

vladra commented Feb 12, 2017

@Monte9 Just encountered this. It's not working on blank new react-native project

@Monte9
Copy link
Collaborator

Monte9 commented Feb 12, 2017

Reopening this issue since that's the case @vladra.

@Monte9 Monte9 reopened this Feb 12, 2017
@binoy14
Copy link
Contributor

binoy14 commented Feb 21, 2017

@vladra @Monte9 I was trying to fix this and i think the problem when doing alignItems of center or even flex-start or flex-end is that the component is present but it has a width of 0. If you set a containerStyle or inputStyle with a width of not 0 then it does show up. I think the solution is to set the default width to be the device width. Thoughts?

@binoy14 binoy14 modified the milestone: 0.10.0 Feb 23, 2017
@Monte9
Copy link
Collaborator

Monte9 commented Feb 24, 2017

I think that's a decent solution. In the case that we add a default height, the user can always use the containerStyle to override the height if need be.
@binoy14 if you have it working on your end, go ahead a push a hot-fix to master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants