From 84c699146f7bead2d0ccf6dbdd5620507e478ca0 Mon Sep 17 00:00:00 2001 From: Lev Date: Mon, 8 Apr 2024 12:38:37 -0700 Subject: [PATCH] end search action --- .../components/inputs/text/search/search/mod.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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);