I am trying to resize select statements within a form using react-bootstrap. However, they are not sizing quite right:
I want the last field to display as City, State(the select), Zip in that order. But for some reason, it's placing the State first. Basically, this is what I have:
<form inline>
<form control>
<select>
<form control>
This is my following code:
<Form inline className="margin-bottom-5">
<FormControl
name='city'
type='text'
size='9'
placeholder='City'
value={this.props.generalInfoForm.get('city')}
onChange={(e) => {
this.props.onChange(this.props.generalInfoForm.set('city', e.target.value))
}}
/>
{' '}
<div className='col-xs-2'>
<Select
className='col-xs-2'
ref='stateSelect'
autofocus
options={select_options['US']}
simpleValue
clearable={false}
name='selected-state'
size='3'
disabled={false}
value={this.props.generalInfoForm.get('state')}
onChange={(state) => {
this.props.onChange(this.props.generalInfoForm.set('state', state))
}}
searchable={false}
/></div>
{' '}
<FormControl
name='zip'
type='text'
placeholder='Zip'
maxLength='4'
size='5'
value={this.props.generalInfoForm.get('zip')}
onChange={(e) => {
this.props.onChange(this.props.generalInfoForm.set('zip', e.target.value))
}}
/>
{' '}
</Form>
Why is the select displaying before the City field? I placed the select after the city field, but it's not working that way. Is it because of the col-xs-2
? But I need to resize select statements, and the method that I found to do that was basically to wrap it in a div
and set a col-**-**
class.
What am I doing wrong? Is there anyway that I can put this select
inline into the form without the weird spacing issues?
Any help would be greatly appreciated as I'm new to bootstrap, thanks!!!