diff --git a/src/components/togglebutton/ToggleButton.d.ts b/src/components/togglebutton/ToggleButton.d.ts index 760c59514f..f342272438 100644 --- a/src/components/togglebutton/ToggleButton.d.ts +++ b/src/components/togglebutton/ToggleButton.d.ts @@ -10,6 +10,7 @@ interface ToggleButtonProps { style?: object; className?: string; checked?: boolean; + tabIndex?: number; tooltip?: any; tooltipOptions?: TooltipOptions; onChange?(e: {originalEvent: Event, value: boolean}): void; diff --git a/src/components/togglebutton/ToggleButton.js b/src/components/togglebutton/ToggleButton.js index 517d4ced6c..261b2f0d89 100644 --- a/src/components/togglebutton/ToggleButton.js +++ b/src/components/togglebutton/ToggleButton.js @@ -14,6 +14,7 @@ export class ToggleButton extends Component { style: null, className: null, checked: false, + tabIndex: 0, tooltip: null, tooltipOptions: null, onChange: null @@ -28,6 +29,7 @@ export class ToggleButton extends Component { style: PropTypes.object, className: PropTypes.string, checked: PropTypes.bool, + tabIndex: PropTypes.number, tooltip: PropTypes.string, tooltipOptions: PropTypes.object, onChange: PropTypes.func @@ -125,7 +127,7 @@ export class ToggleButton extends Component { return (
this.container = el} id={this.props.id} className={className} style={this.props.style} onClick={this.toggle}>
- this.input = el} type="checkbox" onFocus={this.onFocus} onBlur={this.onBlur} onKeyDown={this.onKeyDown} /> + this.input = el} type="checkbox" onFocus={this.onFocus} onBlur={this.onBlur} onKeyDown={this.onKeyDown} tabIndex={this.props.tabIndex}/>
{(this.props.onIcon && this.props.offIcon) && } {this.props.checked ? this.props.onLabel : this.props.offLabel}