Skip to content

Commit

Permalink
Merge pull request #53364 from neonbhai/fix-selection-behavior-worksp…
Browse files Browse the repository at this point in the history
…ace-categories

Fix - Checkbox does not appear next to the categories in Categories RHP
  • Loading branch information
MonilBhavsar authored Dec 13, 2024
2 parents 31ad7c7 + 3483e79 commit e27c5ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {
const currentConnectionName = PolicyUtils.getCurrentConnectionName(policy);
const isQuickSettingsFlow = !!backTo;

const canSelectMultiple = shouldUseNarrowLayout ? selectionMode?.isEnabled : true;
const canSelectMultiple = isSmallScreenWidth ? selectionMode?.isEnabled : true;

const fetchCategories = useCallback(() => {
Category.openPolicyCategoriesPage(policyId);
Expand Down Expand Up @@ -182,7 +182,7 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {
const options: Array<DropdownOption<DeepValueOf<typeof CONST.POLICY.BULK_ACTION_TYPES>>> = [];
const isThereAnyAccountingConnection = Object.keys(policy?.connections ?? {}).length !== 0;

if (shouldUseNarrowLayout ? canSelectMultiple : selectedCategoriesArray.length > 0) {
if (isSmallScreenWidth ? canSelectMultiple : selectedCategoriesArray.length > 0) {
if (!isThereAnyAccountingConnection) {
options.push({
icon: Expensicons.Trashcan,
Expand Down Expand Up @@ -408,7 +408,7 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {
{hasVisibleCategories && !isLoading && (
<SelectionListWithModal
canSelectMultiple={canSelectMultiple}
turnOnSelectionModeOnLongPress
turnOnSelectionModeOnLongPress={isSmallScreenWidth}
onTurnOnSelectionMode={(item) => item && toggleCategory(item)}
sections={[{data: categoryList, isDisabled: false}]}
onCheckboxPress={toggleCategory}
Expand Down

0 comments on commit e27c5ea

Please sign in to comment.