Skip to content
Open
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
3 changes: 3 additions & 0 deletions src/components/CategoryPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import useDebouncedState from '@hooks/useDebouncedState';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import {getCategoryListSections} from '@libs/CategoryOptionListUtils';
import type {Category} from '@libs/CategoryOptionListUtils';
import {getEnabledCategoriesCount} from '@libs/CategoryUtils';
Expand All @@ -29,6 +30,7 @@ type CategoryPickerProps = {
};

function CategoryPicker({selectedCategory, policyID, onSubmit, addBottomSafeAreaPadding = false, contentContainerStyle}: CategoryPickerProps) {
const styles = useThemeStyles();
const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`, {canBeMissing: true});
const [policyCategoriesDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES_DRAFT}${policyID}`, {canBeMissing: true});
const [policyRecentlyUsedCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_CATEGORIES}${policyID}`, {canBeMissing: true});
Expand Down Expand Up @@ -88,6 +90,7 @@ function CategoryPicker({selectedCategory, policyID, onSubmit, addBottomSafeArea
initiallyFocusedOptionKey={selectedOptionKey ?? undefined}
addBottomSafeAreaPadding={addBottomSafeAreaPadding}
contentContainerStyle={contentContainerStyle}
listItemTitleStyles={styles.mnw100}
Copy link
Contributor

@situchan situchan Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the same approach as used in new SelectionList? Or is mnw100 already?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new SelectionList doesn't use a special approach, it uses FlashList instead of SectionList, which avoids the truncation issue. Since SelectionListWithSections uses SectionList, adding mnw100 via listItemTitleStyles is the correct fix for this component.

/>
);
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/TagPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,13 @@ function TagPicker({

const selectedOptionKey = sections.at(0)?.data?.find((policyTag) => policyTag.searchText === selectedTag)?.keyForList;

const listItemTitleStyles = useMemo(() => [styles.breakAll, styles.mnw100], [styles.breakAll, styles.mnw100]);

return (
<SelectionList
ListItem={RadioListItem}
sectionTitleStyles={styles.mt5}
listItemTitleStyles={styles.breakAll}
listItemTitleStyles={listItemTitleStyles}
sections={sections}
textInputValue={searchValue}
headerMessage={headerMessage}
Expand Down
Loading