diff --git a/pgml-dashboard/src/components/inputs/text/search/search/mod.rs b/pgml-dashboard/src/components/inputs/text/search/search/mod.rs index a8740c600..c507f24b1 100644 --- a/pgml-dashboard/src/components/inputs/text/search/search/mod.rs +++ b/pgml-dashboard/src/components/inputs/text/search/search/mod.rs @@ -33,12 +33,6 @@ impl Search { .method("startSearch") .action(StimulusEvents::FocusIn), ) - .input_action( - StimulusAction::new() - .controller("inputs-text-search-search") - .method("endSearch") - .action(StimulusEvents::FocusOut), - ) .input_action( StimulusAction::new() .controller("inputs-text-search-search") @@ -58,6 +52,14 @@ impl Search { self.input = input; self } + + /// Close the dropdown whenever you want. + /// Modify the action to change the event from the default onClick. + pub fn end_search_action() -> StimulusAction { + StimulusAction::new_click() + .controller("inputs-text-search-search") + .method("endSearch") + } } component!(Search);