@@ -214,7 +214,7 @@ const multiSelectFilters = [
214214 "equipments" ,
215215] ;
216216// we don't want to show "showOnlyReservable" as a FilterTag, as it has its own checkbox in the form
217- const hideTagList = [ "showOnlyReservable" , "order" , "sort" ] ;
217+ const hideTagList = [ "showOnlyReservable" , "order" , "sort" , "ref" ] ;
218218
219219// TODO rewrite this witout the form state (use query params directly, but don't refresh the page)
220220export function SingleSearchForm ( {
@@ -270,13 +270,13 @@ export function SingleSearchForm({
270270 }
271271 } ;
272272
273- const search : SubmitHandler < FormValues > = ( criteria : FormValues ) => {
273+ const onSearch : SubmitHandler < FormValues > = ( criteria : FormValues ) => {
274274 // Remove empty (null || "") values from the criteria
275275 const searchCriteria = Object . entries ( criteria ) . reduce ( ( c , cv ) => {
276276 if ( cv [ 1 ] == null || cv [ 1 ] === "" ) return c ;
277277 return { ...c , [ cv [ 0 ] ] : cv [ 1 ] } ;
278278 } , { } ) ;
279- handleSearch ( searchCriteria ) ;
279+ handleSearch ( searchCriteria , true ) ;
280280 } ;
281281
282282 const showOptionalFilters =
@@ -286,7 +286,7 @@ export function SingleSearchForm({
286286 formValues . textSearch != null ;
287287
288288 return (
289- < form noValidate onSubmit = { handleSubmit ( search ) } >
289+ < form noValidate onSubmit = { handleSubmit ( onSearch ) } >
290290 < TopContainer >
291291 < Filters >
292292 < ControlledMultiSelect
@@ -397,7 +397,7 @@ export function SingleSearchForm({
397397 placeholder = { t ( "searchForm:searchTermPlaceholder" ) }
398398 onKeyDown = { ( e ) => {
399399 if ( e . key === "Enter" ) {
400- handleSubmit ( search ) ( ) ;
400+ handleSubmit ( onSearch ) ( ) ;
401401 }
402402 } }
403403 />
0 commit comments