From cfaad117e63c4f1620e7bf825c624f3987a39899 Mon Sep 17 00:00:00 2001 From: Chaitanya Gadodia Date: Fri, 1 Feb 2019 19:50:07 +0530 Subject: [PATCH 1/3] option group search autofocus --- src/components/Search.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Search.tsx b/src/components/Search.tsx index 79b2af5a..922bf942 100644 --- a/src/components/Search.tsx +++ b/src/components/Search.tsx @@ -46,6 +46,7 @@ class Search extends React.PureComponent { }} ref={this.searchInputRef} value={value} + autoFocus {...inputProps} /> {clearable && ( From 55e3c600ebc5e023d48d39467d90cbad49067e45 Mon Sep 17 00:00:00 2001 From: Chaitanya Gadodia Date: Mon, 4 Feb 2019 13:06:21 +0530 Subject: [PATCH 2/3] snapshot updated --- .../__tests__/__snapshots__/optionGroup.test.tsx.snap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/__tests__/__snapshots__/optionGroup.test.tsx.snap b/src/components/__tests__/__snapshots__/optionGroup.test.tsx.snap index 7f10dc1b..a9b38363 100644 --- a/src/components/__tests__/__snapshots__/optionGroup.test.tsx.snap +++ b/src/components/__tests__/__snapshots__/optionGroup.test.tsx.snap @@ -610,6 +610,7 @@ Array [ /> Date: Tue, 5 Feb 2019 14:05:02 +0530 Subject: [PATCH 3/3] option group only --- src/components/Search.tsx | 1 - src/components/shared/OptionGroup.tsx | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Search.tsx b/src/components/Search.tsx index 922bf942..79b2af5a 100644 --- a/src/components/Search.tsx +++ b/src/components/Search.tsx @@ -46,7 +46,6 @@ class Search extends React.PureComponent { }} ref={this.searchInputRef} value={value} - autoFocus {...inputProps} /> {clearable && ( diff --git a/src/components/shared/OptionGroup.tsx b/src/components/shared/OptionGroup.tsx index 39cd592f..a954b256 100644 --- a/src/components/shared/OptionGroup.tsx +++ b/src/components/shared/OptionGroup.tsx @@ -156,7 +156,8 @@ class OptionGroup extends React.PureComponent< {...searchBoxProps} inputProps={{ ...(searchBoxProps && searchBoxProps.inputProps), - onKeyDown: this.handleKeyPress + onKeyDown: this.handleKeyPress, + autoFocus: true }} />