Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix - Tags - In expense report, full tag name is not shown in tag list page #53940

Merged
Merged
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
2 changes: 2 additions & 0 deletions src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function BaseSelectionList<TItem extends ListItem>(
shouldPreventActiveCellVirtualization = false,
shouldScrollToFocusedIndex = true,
onContentSizeChange,
listItemTitleStyles,
}: BaseSelectionListProps<TItem>,
ref: ForwardedRef<SelectionListHandle>,
) {
Expand Down Expand Up @@ -524,6 +525,7 @@ function BaseSelectionList<TItem extends ListItem>(
normalizedIndex={normalizedIndex}
shouldSyncFocus={!isTextInputFocusedRef.current}
wrapperStyle={listItemWrapperStyle}
titleStyles={listItemTitleStyles}
shouldHighlightSelectedItem={shouldHighlightSelectedItem}
singleExecution={singleExecution}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import type {StyleProp, TextStyle} from 'react-native';
import type useArrowKeyFocusManager from '@hooks/useArrowKeyFocusManager';
import type useSingleExecution from '@hooks/useSingleExecution';
import * as SearchUIUtils from '@libs/SearchUIUtils';
Expand All @@ -11,6 +12,7 @@ type BaseSelectionListItemRendererProps<TItem extends ListItem> = Omit<BaseListI
setFocusedIndex: ReturnType<typeof useArrowKeyFocusManager>[1];
normalizedIndex: number;
singleExecution: ReturnType<typeof useSingleExecution>['singleExecution'];
titleStyles?: StyleProp<TextStyle>;
};

function BaseSelectionListItemRenderer<TItem extends ListItem>({
Expand All @@ -37,6 +39,7 @@ function BaseSelectionListItemRenderer<TItem extends ListItem>({
shouldSyncFocus,
shouldHighlightSelectedItem,
wrapperStyle,
titleStyles,
singleExecution,
}: BaseSelectionListItemRendererProps<TItem>) {
const handleOnCheckboxPress = () => {
Expand Down Expand Up @@ -82,6 +85,7 @@ function BaseSelectionListItemRenderer<TItem extends ListItem>({
shouldSyncFocus={shouldSyncFocus}
shouldHighlightSelectedItem={shouldHighlightSelectedItem}
wrapperStyle={wrapperStyle}
titleStyles={titleStyles}
/>
{item.footerContent && item.footerContent}
</>
Expand Down
2 changes: 2 additions & 0 deletions src/components/SelectionList/RadioListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function RadioListItem<TItem extends ListItem>({
onFocus,
shouldSyncFocus,
wrapperStyle,
titleStyles,
}: RadioListItemProps<TItem>) {
const styles = useThemeStyles();
const fullTitle = isMultilineSupported ? item.text?.trimStart() : item.text;
Expand Down Expand Up @@ -59,6 +60,7 @@ function RadioListItem<TItem extends ListItem>({
item.alternateText ? styles.mb1 : null,
isDisabled && styles.colorMuted,
isMultilineSupported ? {paddingLeft} : null,
titleStyles,
]}
numberOfLines={isMultilineSupported ? 2 : 1}
/>
Expand Down
6 changes: 6 additions & 0 deletions src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ type ListItemProps<TItem extends ListItem> = CommonListItemProps<TItem> & {

/** Whether we highlight all the selected items */
shouldHighlightSelectedItem?: boolean;

/** Styles applied for the title */
titleStyles?: StyleProp<TextStyle>;
};

type BaseListItemProps<TItem extends ListItem> = CommonListItemProps<TItem> & {
Expand Down Expand Up @@ -563,6 +566,9 @@ type BaseSelectionListProps<TItem extends ListItem> = Partial<ChildrenProps> & {
/** Styles for the section title */
sectionTitleStyles?: StyleProp<ViewStyle>;

/** Styles applid for the title of the list item */
listItemTitleStyles?: StyleProp<TextStyle>;

/** This may improve scroll performance for large lists */
removeClippedSubviews?: boolean;

Expand Down
1 change: 1 addition & 0 deletions src/components/TagPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ function TagPicker({selectedTag, tagListName, policyID, tagListIndex, shouldShow
<SelectionList
ListItem={RadioListItem}
sectionTitleStyles={styles.mt5}
listItemTitleStyles={styles.breakAll}
sections={sections}
textInputValue={searchValue}
headerMessage={headerMessage}
Expand Down
Loading