Skip to content

Commit

Permalink
Merge pull request #46679 from neonbhai/selection-dropdown-fix
Browse files Browse the repository at this point in the history
Fix: Dropdown button is not disabled when no selection is made
(cherry picked from commit 7b1b260)
  • Loading branch information
roryabraham authored and OSBotify committed Aug 1, 2024
1 parent fe7d25a commit 07c3f2f
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/pages/ReportParticipantsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ function ReportParticipantsPage({report}: WithReportOrNotFoundProps) {
onPress={() => null}
options={bulkActionsButtonOptions}
style={[shouldUseNarrowLayout && styles.flexGrow1]}
isDisabled={!selectedMembers.length}
/>
) : (
<Button
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/WorkspaceMembersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson
options={getBulkActionsButtonOptions()}
isSplitButton={false}
style={[shouldUseNarrowLayout && styles.flexGrow1, shouldUseNarrowLayout && styles.mb3]}
isDisabled={!selectedEmployees.length}
/>
) : (
<Button
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {
options={options}
isSplitButton={false}
style={[shouldUseNarrowLayout && styles.flexGrow1, shouldUseNarrowLayout && styles.mb3]}
isDisabled={!selectedCategoriesArray.length}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ function PolicyDistanceRatesPage({
style={[shouldUseNarrowLayout && styles.flexGrow1]}
wrapperStyle={styles.w100}
isSplitButton={false}
isDisabled={!selectedDistanceRates.length}
/>
)}
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ function ReportFieldsListValuesPage({
options={options}
isSplitButton={false}
style={[isSmallScreenWidth && styles.flexGrow1, isSmallScreenWidth && styles.mb3]}
isDisabled={!selectedValuesArray.length}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ function WorkspaceReportFieldsPage({
options={options}
isSplitButton={false}
style={[shouldUseNarrowLayout && styles.flexGrow1, shouldUseNarrowLayout && styles.mb3]}
isDisabled={!selectedReportFields.length}
/>
);
}
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/tags/WorkspaceTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
customText={translate('workspace.common.selected', {selectedNumber: selectedTagsArray.length})}
options={options}
style={[shouldUseNarrowLayout && styles.flexGrow1, shouldUseNarrowLayout && styles.mb3]}
isDisabled={!selectedTagsArray.length}
/>
);
};
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/tags/WorkspaceViewTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ function WorkspaceViewTagsPage({route}: WorkspaceViewTagsProps) {
customText={translate('workspace.common.selected', {selectedNumber: selectedTagsArray.length})}
options={options}
style={[shouldUseNarrowLayout && styles.flexGrow1, shouldUseNarrowLayout && styles.mb3]}
isDisabled={!selectedTagsArray.length}
/>
);
};
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/taxes/WorkspaceTaxesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ function WorkspaceTaxesPage({
pressOnEnter
isSplitButton={false}
style={[shouldUseNarrowLayout && styles.flexGrow1, shouldUseNarrowLayout && styles.mb3]}
isDisabled={!selectedTaxesIDs.length}
/>
);

Expand Down

0 comments on commit 07c3f2f

Please sign in to comment.