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

Remove tooltip of base section list #33580

Merged
merged 10 commits into from
Jan 12, 2024
6 changes: 3 additions & 3 deletions src/components/SelectionList/BaseSelectionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function BaseSelectionList({
disableKeyboardShortcuts = false,
children,
shouldStopPropagation = false,
shouldShowTooltip = true,
shouldShowTooltips = true,
shouldUseDynamicMaxToRenderPerBatch = false,
}) {
const theme = useTheme();
Expand Down Expand Up @@ -304,15 +304,15 @@ function BaseSelectionList({
const isDisabled = section.isDisabled || item.isDisabled;
const isItemFocused = !isDisabled && focusedIndex === normalizedIndex;
// We only create tooltips for the first 10 users or so since some reports have hundreds of users, causing performance to degrade.
const showTooltip = normalizedIndex < 10;
const showTooltip = shouldShowTooltips && normalizedIndex < 10;

return (
<BaseListItem
item={item}
isFocused={isItemFocused}
isDisabled={isDisabled}
isHide={!maxToRenderPerBatch}
showTooltip={showTooltip && shouldShowTooltip}
showTooltip={showTooltip}
canSelectMultiple={canSelectMultiple}
onSelectRow={() => selectRow(item, true)}
disableIsFocusStyle={disableInitialFocusOptionStyle}
Expand Down
2 changes: 1 addition & 1 deletion src/components/SelectionList/selectionListPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const propTypes = {
footerContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),

/** Whether to show the toolip text */
shouldShowTooltip: PropTypes.bool,
shouldShowTooltips: PropTypes.bool,

/** Whether to use dynamic maxToRenderPerBatch depending on the visible number of elements */
shouldUseDynamicMaxToRenderPerBatch: PropTypes.bool,
Expand Down
1 change: 1 addition & 0 deletions src/components/ValuePicker/ValueSelectorModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function ValueSelectorModal({items, selectedItem, label, isVisible, onClose, onI
onSelectRow={onItemSelected}
initiallyFocusedOptionKey={selectedItem.value}
shouldStopPropagation
shouldShowTooltips={false}
dukenv0307 marked this conversation as resolved.
Show resolved Hide resolved
/>
</ScreenWrapper>
</Modal>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings/Profile/TimezoneSelectPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function TimezoneSelectPage(props) {
sections={[{data: timezoneOptions, indexOffset: 0, isDisabled: timezone.automatic}]}
initiallyFocusedOptionKey={_.get(_.filter(timezoneOptions, (tz) => tz.text === timezone.selected)[0], 'keyForList')}
showScrollIndicator
shouldShowTooltip={false}
shouldShowTooltips={false}
/>
</ScreenWrapper>
);
Expand Down
Loading