React-select: Allow autoFocus

Created on 22 Aug 2015  路  3Comments  路  Source: JedWatson/react-select

Should render autoFocus on input.

<Select
  autoFocus
  onChange={actions.search.onAddressAutocompleteChange}
  placeholder={msg.placeholder}
  value={search.addressAutocompleteValue}
/>

Most helpful comment

As it turns out this _is_ actually supported, but the prop is autofocus, unlike the JSX/DOM api for regular dom inputs. @JedWatson what do you think of using autoFocus instead for consistency with those apis? Probably ought to support both in the meantime as to not break the current api.

All 3 comments

As it turns out this _is_ actually supported, but the prop is autofocus, unlike the JSX/DOM api for regular dom inputs. @JedWatson what do you think of using autoFocus instead for consistency with those apis? Probably ought to support both in the meantime as to not break the current api.

Why is the prop autofocus depricated then?

I didn't link this issue when I fixed this (there were a couple) - as of v1.0.0 the prop was renamed to autoFocus and the old autofocus prop has been deprecated but continues to work in 1.x for backwards compatibilty.

The autofocus prop will be removed in v2.0.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MindRave picture MindRave  路  3Comments

MalcolmDwyer picture MalcolmDwyer  路  3Comments

AchinthaReemal picture AchinthaReemal  路  3Comments

coder-guy22296 picture coder-guy22296  路  3Comments

pashap picture pashap  路  3Comments