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

placeholder text to the left #65

Open
jahnavi310 opened this issue Jul 18, 2018 · 1 comment
Open

placeholder text to the left #65

jahnavi310 opened this issue Jul 18, 2018 · 1 comment

Comments

@jahnavi310
Copy link

Hi there,

I am trying to place the placeholder text to the extreme left instead of having it center aligned. I tried playing around with some of the props but unfortunately none of them worked.

Any idea on how we can do this?

@se1exin
Copy link
Contributor

se1exin commented Jul 19, 2018

I needed this too, I solved it by making the Collapsed Margin the same width of the half the input, less the desired Expanded Margin.

The formula I used is (Half the window width) - (Container Margin Left + Expanded Margin). In my case the View that contains the SearchBox has a Horizontal margin of 15..

Props:

searchIconExpandedMargin={ 20 }
searchIconCollapsedMargin={ (Dimensions.get('window').width / 2) - (15 + 20) }
placeholderExpandedMargin={ 40 }
placeholderCollapsedMargin={ (Dimensions.get('window').width / 2) - (15 + 40) }

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

No branches or pull requests

2 participants