Skip to content
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

UHF-9883: Fix Clear selections button in school search #956

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion dist/js/school-search.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ const FeatureFormContainer = () => {

if (keyword.value && keyword.value.length) {
params.keyword = keyword.value;
};
}

[finnish_education, grades_1_6, grades_1_9, grades_7_9, swedish_education].forEach(element => {
if (!element || !element.checked || !element.name) {
return;
};
}

const name = element.name as keyof Omit<SearchParams, 'keyword'|'page'|'query'|'a1'|'a2'|'b1'|'b2'|'weighted_education'|'bilingual_education'>;
params[name] = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ProximityFormContainer = () => {

if (keyword.value && keyword.value.length) {
params.keyword = keyword.value;
};
}

setParams(params);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ const SelectionsContainer = ({ keys }: SelectionsContainerProps) => {

const resetForm = () => {
setSearchParams({});

// Reset individual selection atoms to their default states
updateA1([]);
updateA2([]);
updateB1([]);
updateB2([]);
updateWeighted([]);
updateBilingual([]);
};

const showClearButton =
Expand Down
Loading