Skip to content

Commit

Permalink
reset selected values on navigate
Browse files Browse the repository at this point in the history
  • Loading branch information
rezkiy37 committed Jul 2, 2024
1 parent a78985e commit 05d3319
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/pages/workspace/reportFields/WorkspaceListValuesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ function WorkspaceListValuesPage({
setDeleteValuesConfirmModalVisible(false);
};

const openListValuePage = (valueItem: ValueListItem) => {
if (valueItem.index === undefined) {
return;
}

Navigation.navigate(ROUTES.WORKSPACE_REPORT_FIELD_VALUE_SETTINGS.getRoute(policyID, valueItem.index));

setSelectedValues({});
};

const getCustomListHeader = () => (
<View style={[styles.flex1, styles.flexRow, styles.justifyContentBetween, styles.pl3]}>
<Text style={styles.searchInputStyle}>{translate('common.name')}</Text>
Expand Down Expand Up @@ -236,7 +246,7 @@ function WorkspaceListValuesPage({
canSelectMultiple
sections={listValuesSections}
onCheckboxPress={toggleValue}
onSelectRow={(item) => item.index !== undefined && Navigation.navigate(ROUTES.WORKSPACE_REPORT_FIELD_VALUE_SETTINGS.getRoute(policyID, item.index))}
onSelectRow={openListValuePage}
shouldDebounceRowSelect={false}
onSelectAll={toggleAllValues}
ListItem={TableListItem}
Expand Down

0 comments on commit 05d3319

Please sign in to comment.