Skip to content

Commit

Permalink
Merge pull request Expensify#57452 from bernhardoj/fix/57310-subrate-…
Browse files Browse the repository at this point in the history
…text-is-small

Fix label is small when no value is selected
  • Loading branch information
NikkiWines authored Feb 26, 2025
2 parents 8f5d4d0 + 295dfcd commit 932f977
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/components/ValuePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ import React, {forwardRef, useState} from 'react';
import type {ForwardedRef} from 'react';
import {View} from 'react-native';
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
import useStyleUtils from '@hooks/useStyleUtils';
import Navigation from '@libs/Navigation/Navigation';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import type {ValuePickerItem, ValuePickerProps} from './types';
import ValueSelectorModal from './ValueSelectorModal';

function ValuePicker({value, label, items, placeholder = '', errorText = '', onInputChange, furtherDetails, shouldShowTooltips = true}: ValuePickerProps, forwardedRef: ForwardedRef<View>) {
const StyleUtils = useStyleUtils();
const [isPickerVisible, setIsPickerVisible] = useState(false);

const showPickerModal = () => {
Expand All @@ -28,7 +25,6 @@ function ValuePicker({value, label, items, placeholder = '', errorText = '', onI
hidePickerModal();
};

const descStyle = !value || value.length === 0 ? StyleUtils.getFontSizeStyle(variables.fontSizeLabel) : null;
const selectedItem = items?.find((item) => item.value === value);

return (
Expand All @@ -38,7 +34,6 @@ function ValuePicker({value, label, items, placeholder = '', errorText = '', onI
shouldShowRightIcon
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
title={selectedItem?.label || placeholder || ''}
descriptionTextStyle={descStyle}
description={label}
onPress={showPickerModal}
furtherDetails={furtherDetails}
Expand Down

0 comments on commit 932f977

Please sign in to comment.