Skip to content

end search action #1397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions pgml-dashboard/src/components/inputs/text/search/search/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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);