Skip to content

Commit a3a6c55

Browse files
committed
refactor: use min-height instead of height for custom element
1 parent 0ab0a21 commit a3a6c55

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

packages/components/select/base/Option.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ const Option: React.FC<SelectOptionProps> = (props) => {
7171
const [allSelectableChecked, setAllSelectableChecked] = useState(initCheckedStatus);
7272

7373
const displayedContent = children || content || label;
74-
const isCustomElement = React.isValidElement(displayedContent);
7574

7675
const titleContent = useMemo(() => {
7776
// 外部设置 props,说明希望受控
@@ -173,10 +172,7 @@ const Option: React.FC<SelectOptionProps> = (props) => {
173172
key={value}
174173
onClick={handleSelect}
175174
ref={setRefCurrent}
176-
style={{
177-
...(isCustomElement ? { height: 'auto' } : {}),
178-
...style,
179-
}}
175+
style={style}
180176
>
181177
{renderItem()}
182178
</li>

0 commit comments

Comments
 (0)