Skip to content

Commit

Permalink
mj - dont tab to button on date input
Browse files Browse the repository at this point in the history
  • Loading branch information
mjewell committed Jul 20, 2017
1 parent 14c4355 commit 5aebbc0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/DateInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,13 @@ export default class DateInput extends Component {
disabled={disabled}
/>
<InputGroupButton onClick={this.toggle}>
<Button className="px-2" disabled={disabled} active={open} type="button">
<Button
className="px-2"
disabled={disabled}
active={open}
type="button"
tabIndex={-1}
>
<Icon name="calendar" fixedWidth />
</Button>
</InputGroupButton>
Expand Down
8 changes: 8 additions & 0 deletions test/components/DateInput.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ describe('<DateInput />', () => {
});
});

it('should not tab to the calendar button', () => {
const component = mount(<DateInput />);

const toggle = component.find('InputGroupButton');
const calendarButton = toggle.find('Button');
assert.equal(calendarButton.props().tabIndex, -1);
});

it('should should open and close when input addon clicked', () => {
const component = mount(<DateInput />);
const dropdown = component.find('Dropdown');
Expand Down

0 comments on commit 5aebbc0

Please sign in to comment.