diff --git a/packages/openchs-android/src/action/individual/IndividualSearchActions.js b/packages/openchs-android/src/action/individual/IndividualSearchActions.js
index 8a077bd59..3a535e669 100644
--- a/packages/openchs-android/src/action/individual/IndividualSearchActions.js
+++ b/packages/openchs-android/src/action/individual/IndividualSearchActions.js
@@ -8,7 +8,7 @@ import _ from "lodash";
import PrivilegeService from "../../service/PrivilegeService";
import {firebaseEvents, logEvent} from "../../utility/Analytics";
import AddressLevelState from "../common/AddressLevelsState";
-import { CustomFilter } from "openchs-models";
+import {ArrayUtil, CustomFilter} from "openchs-models";
export class IndividualSearchActions {
static clone(state) {
@@ -176,7 +176,9 @@ export class IndividualSearchActions {
}
static genderChange(state, action) {
- return {...state, selectedGenders: action.selectedGenders};
+ let selectedGenders = state.selectedGenders || [];
+ ArrayUtil.toggle(selectedGenders, action.selectedGender, (l,r) => l.uuid === r.uuid)
+ return {...state, selectedGenders};
}
static loadIndicator(state, action) {
diff --git a/packages/openchs-android/src/views/filter/FiltersViewV2.js b/packages/openchs-android/src/views/filter/FiltersViewV2.js
index 51e4f0a38..32bc90402 100644
--- a/packages/openchs-android/src/views/filter/FiltersViewV2.js
+++ b/packages/openchs-android/src/views/filter/FiltersViewV2.js
@@ -164,7 +164,7 @@ class FiltersViewV2 extends AbstractComponent {
switch (filterConfig.type) {
case CustomFilter.type.Gender:
- return : null}
{this.customFilterService.filterTypePresent(filterScreenName, CustomFilter.type.Gender, subjectTypeUUID) &&
this.dispatchAction(Actions.GENDER_CHANGE, {selectedGenders})}
+ selectedGenders={this.state.selectedGenders || []}
+ onSelect={(selectedGender) => this.dispatchAction(Actions.GENDER_CHANGE, {selectedGender})}
/>}
{this.customFilterService.filterTypePresent(filterScreenName, CustomFilter.type.Address, subjectTypeUUID) &&