Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…to feature-pagination
  • Loading branch information
dhirendra777 committed Oct 6, 2020
2 parents ae3426c + 2e396bb commit 9f84caa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/components/MultiSelect/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const MultiSelect: FC<MultiSelectProps> & WithStyle = React.memo(
setInputValue(value);
const newOptions = filterOptions(options, value);
newOptions.length && value ? setOptions(newOptions) : updateToDefaultOptions();
!areOptionsVisible && showOptions();
!areOptionsVisible && setOptionsVisibilityState(true);
},
[areOptionsVisible, options, updateToDefaultOptions]
),
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/components/SingleSelect/SingleSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export const SingleSelect: FC<SelectProps> & WithStyle = React.memo(

const showOptions = useCallback(() => {
setOptionsVisibilityState(true);
inputRef.current.setSelectionRange && inputRef.current.setSelectionRange(inputValue.length, inputValue.length);
isSearchable && setInputValue('');
inputRef.current.focus();
}, [inputValue]),
}, [isSearchable, inputValue]),
hideOptions = useCallback(() => {
setOptionsVisibilityState(false);
inputRef.current && inputRef.current.blur();
Expand All @@ -64,7 +64,7 @@ export const SingleSelect: FC<SelectProps> & WithStyle = React.memo(
newOptions = filterOptions(getUpdatedOptions(defaultOptions, selectedOption), target.value);
setInputValue(target.value);
newOptions.length && target.value ? setOptions(newOptions) : updateToDefaultOptions();
!areOptionsVisible && showOptions();
!areOptionsVisible && setOptionsVisibilityState(true);
},
[areOptionsVisible, defaultOptions, selectedOption, updateToDefaultOptions]
),
Expand Down

0 comments on commit 9f84caa

Please sign in to comment.