Skip to content

Commit

Permalink
Merge branch 'main' into allow_description_edition
Browse files Browse the repository at this point in the history
  • Loading branch information
basseche authored Jan 7, 2025
2 parents c3ed496 + c609562 commit 4dc80a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gridsuite/commons-ui",
"version": "0.76.0",
"version": "0.76.2",
"description": "common react components for gridsuite applications",
"engines": {
"npm": ">=9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import { Autocomplete, AutocompleteProps, AutocompleteRenderInputParams } from '@mui/material';
import { Autocomplete, AutocompleteProps, AutocompleteRenderInputParams, createFilterOptions } from '@mui/material';
import { HTMLAttributes, ReactNode, useMemo } from 'react';
import { useIntl } from 'react-intl';

Expand Down Expand Up @@ -53,7 +53,15 @@ export function ElementSearchInput<T>(props: Readonly<ElementSearchInputProps<T>
} = props;

const intl = useIntl();

const filterOptions = useMemo(
() =>
createFilterOptions<T>({
matchFrom: 'any',
trim: true,
ignoreCase: true,
}),
[]
);
const displayedValue = useMemo(() => {
if (searchTermDisabled || searchTermDisableReason) {
return (
Expand Down Expand Up @@ -120,6 +128,7 @@ export function ElementSearchInput<T>(props: Readonly<ElementSearchInputProps<T>
}}
disabled={searchTermDisabled}
PaperComponent={PaperComponent}
filterOptions={filterOptions}
/>
);
}

0 comments on commit 4dc80a5

Please sign in to comment.