diff --git a/src/Field/WfsSearchField/WfsSearchField.tsx b/src/Field/WfsSearchField/WfsSearchField.tsx index 6b31e2deb..5d2c700cf 100644 --- a/src/Field/WfsSearchField/WfsSearchField.tsx +++ b/src/Field/WfsSearchField/WfsSearchField.tsx @@ -27,6 +27,7 @@ export type WfsSearchFieldProps = { onBeforeSearch?: (value: string) => string; onChange?: (val: OlFeature[] | undefined) => undefined; value?: OlFeature[] | undefined; + visible?: boolean; } & SearchConfig & Omit & Omit; const defaultClassName = `${CSS_PREFIX}wfssearch`; @@ -63,6 +64,7 @@ export const WfsSearchField: FC = ({ wfsFormatOptions, onFetchError, onFetchSuccess, + visible, ...passThroughProps }) => { @@ -228,6 +230,10 @@ export const WfsSearchField: FC = ({ ); } + if (!visible) { + return null; + } + return ( allowClear={true}