Skip to content

Commit c34fedd

Browse files
authored
Add maxLength to search input and not allow to select 'No results found' option (#2541)
1 parent 9790ba1 commit c34fedd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: libs/ui-lib/lib/common/components/ui/OpenshiftSelectWithSearch.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ export const OpenshiftSelectWithSearch: React.FunctionComponent<OpenshiftSelectW
5555
const { t } = useTranslation();
5656
const [helperText, setHelperText] = React.useState(getHelperText(versions, inputValue, t, true));
5757

58+
React.useEffect(() => {
59+
if (textInputRef.current) {
60+
textInputRef.current.maxLength = 30;
61+
}
62+
}, []);
63+
5864
React.useEffect(() => {
5965
let newSelectOptions: SelectOptionProps[] = initialSelectOptions;
6066

@@ -68,7 +74,7 @@ export const OpenshiftSelectWithSearch: React.FunctionComponent<OpenshiftSelectW
6874
if (!newSelectOptions.length) {
6975
newSelectOptions = [
7076
{
71-
isDisabled: false,
77+
isDisabled: true,
7278
children: `No results found for "${filterValue}"`,
7379
value: 'no results',
7480
},

0 commit comments

Comments
 (0)