Skip to content

Commit 236853d

Browse files
committed
chore: adjust some logic
1 parent e20892c commit 236853d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/BaseSelect/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ const BaseSelect = React.forwardRef<BaseSelectRef, BaseSelectProps>((props, ref)
337337
const mergedPopupClassName = popupClassName ?? dropdownClassName;
338338
const mergedPopupRender = popupRender ?? dropdownRender;
339339
const mergedPopupAlign = popupAlign ?? dropdownAlign;
340-
340+
const mergedPopupMatchSelectWidth = popupMatchSelectWidth ?? dropdownMatchSelectWidth;
341341
// ============================= Mobile =============================
342342
const [mobile, setMobile] = React.useState(false);
343343
React.useEffect(() => {
@@ -800,7 +800,7 @@ const BaseSelect = React.forwardRef<BaseSelectRef, BaseSelectProps>((props, ref)
800800
popupStyle={mergedPopupStyle}
801801
popupClassName={mergedPopupClassName}
802802
direction={direction}
803-
popupMatchSelectWidth={popupMatchSelectWidth}
803+
popupMatchSelectWidth={mergedPopupMatchSelectWidth}
804804
popupRender={mergedPopupRender}
805805
popupAlign={mergedPopupAlign}
806806
placement={placement}

src/Select.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,8 @@ const Select = React.forwardRef<BaseSelectRef, SelectProps<any, DefaultOptionTyp
609609
};
610610

611611
// ========================== Context ===========================
612-
const mergedPopupMatchSelectWidth = popupMatchSelectWidth ?? dropdownMatchSelectWidth;
613-
614612
const selectContext = React.useMemo<SelectContextProps>(() => {
615-
const realVirtual = virtual !== false && mergedPopupMatchSelectWidth !== false;
613+
const realVirtual = virtual !== false && popupMatchSelectWidth !== false;
616614
return {
617615
...parsedOptions,
618616
flattenOptions: displayOptions,
@@ -641,7 +639,7 @@ const Select = React.forwardRef<BaseSelectRef, SelectProps<any, DefaultOptionTyp
641639
rawValues,
642640
mergedFieldNames,
643641
virtual,
644-
mergedPopupMatchSelectWidth,
642+
popupMatchSelectWidth,
645643
direction,
646644
listHeight,
647645
listItemHeight,
@@ -678,7 +676,7 @@ const Select = React.forwardRef<BaseSelectRef, SelectProps<any, DefaultOptionTyp
678676
onSearch={onInternalSearch}
679677
autoClearSearchValue={autoClearSearchValue}
680678
onSearchSplit={onInternalSearchSplit}
681-
popupMatchSelectWidth={mergedPopupMatchSelectWidth}
679+
popupMatchSelectWidth={popupMatchSelectWidth}
682680
// >>> OptionList
683681
OptionList={OptionList}
684682
emptyOptions={!displayOptions.length}

0 commit comments

Comments
 (0)