Skip to content

Commit

Permalink
Add focus() and blur() to Input.Search
Browse files Browse the repository at this point in the history
  • Loading branch information
yesmeck committed Dec 1, 2017
1 parent e613dc9 commit 2299ad4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/input/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ export default class Search extends React.Component<SearchProps, any> {
this.input.focus();
}

focus() {
this.input.focus();
}

blur() {
this.input.blur();
}

saveInput = (node: Input) => {
this.input = node;
}
Expand Down
6 changes: 6 additions & 0 deletions components/input/__tests__/Search.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Search from '../Search';
import focusTest from '../../../tests/shared/focusTest';

describe('Input.Search', () => {
focusTest(Search);
});

0 comments on commit 2299ad4

Please sign in to comment.