Skip to content

Commit

Permalink
[added] autoFocus support
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Oct 3, 2015
1 parent 40879f7 commit 44818fd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/Combobox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ let propTypes = {

onSelect: React.PropTypes.func,

autoFocus: React.PropTypes.bool,
disabled: CustomPropTypes.disabled,
readOnly: CustomPropTypes.readOnly,
autoFocus: React.PropTypes.bool,
Expand Down Expand Up @@ -204,6 +205,7 @@ var ComboBox = React.createClass({
suggest={suggest}
name={name}
role='combobox'
autoFocus={this.props.autoFocus}
aria-owns={listID}
aria-busy={!!busy}
aria-autocomplete={completeType}
Expand Down
2 changes: 2 additions & 0 deletions src/DateTimePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ let propTypes = {
initialView: React.PropTypes.oneOf(viewEnum),
finalView: React.PropTypes.oneOf(viewEnum),

autoFocus: React.PropTypes.bool,
disabled: CustomPropTypes.disabled,
readOnly: CustomPropTypes.readOnly,
autoFocus: React.PropTypes.bool,
Expand Down Expand Up @@ -186,6 +187,7 @@ var DateTimePicker = React.createClass({
autoFocus={autoFocus}
tabIndex={tabIndex || 0}
role='combobox'
autoFocus={this.props.autoFocus}
aria-labelledby={ariaLabelledby}
aria-expanded={!!open}
aria-busy={!!busy}
Expand Down
10 changes: 6 additions & 4 deletions src/Multiselect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ var propTypes = {

placeholder: React.PropTypes.string,

disabled: CustomPropTypes.disabled.acceptsArray,
readOnly: CustomPropTypes.readOnly.acceptsArray,
autoFocus: React.PropTypes.bool,
autoFocus: React.PropTypes.bool,
disabled: CustomPropTypes.disabled.acceptsArray,
readOnly: CustomPropTypes.readOnly.acceptsArray,


messages: React.PropTypes.shape({
open: CustomPropTypes.message,
Expand Down Expand Up @@ -120,7 +121,7 @@ var Multiselect = React.createClass({
getInitialState(){
var { data, value, valueField, searchTerm } = this.props
, dataItems = splat(value).map( item => dataItem(data, item, valueField))
, processedData = this.process(this.props.data, dataItems, searchTerm)
, processedData = this.process(data, dataItems, searchTerm)

return {
focusedTag: null,
Expand Down Expand Up @@ -251,6 +252,7 @@ var Multiselect = React.createClass({
role='listbox'
aria-expanded={open}
aria-busy={!!busy}
autoFocus={this.props.autoFocus}
aria-owns={listID
+ ' ' + instanceId(this, '__notify')
+ (shouldRenderTags ? (' ' + tagsID) : '')
Expand Down
2 changes: 2 additions & 0 deletions src/NumberPicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ let propTypes = {

parse: React.PropTypes.func,

autoFocus: React.PropTypes.bool,
disabled: CustomPropTypes.disabled,
readOnly: CustomPropTypes.readOnly,
autoFocus: React.PropTypes.bool,
Expand Down Expand Up @@ -153,6 +154,7 @@ let NumberPicker = React.createClass({
name={this.props.name}
role='spinbutton'
min={this.props.min}
autoFocus={this.props.autoFocus}
aria-valuenow={val}
aria-valuemin={isFinite(this.props.min) ? this.props.min : null }
aria-valuemax={isFinite(this.props.max) ? this.props.max : null }
Expand Down

0 comments on commit 44818fd

Please sign in to comment.