Test select (#4611)

* 修复表单单选选中长文本时,文字溢出选择框的问题;修复表单单选下拉选项在移动端界面上触发自动换行时部分文字位于屏幕之外的问题 (#4600)

* fix: 修复表单单选选中长文本时,文字溢出选择框的问题

* fix: 修复表单单选下拉选项在移动端界面上触发自动换行时部分文字位于屏幕之外的问题

* perf: select components

---------

Co-authored-by: mmagi <magizhang@qq.com>
This commit is contained in:
Archer
2025-04-21 15:02:54 +08:00
committed by GitHub
parent 9cd6d2e81f
commit d8fe9806e6

View File

@@ -166,20 +166,14 @@ const MySelect = <T = any,>(
const isSelecting = loading || isLoading;
return (
<Box
css={css({
'& div': {
width: 'auto !important'
}
})}
>
<Box>
<Menu
autoSelect={false}
isOpen={isOpen && !isSelecting}
onOpen={onOpen}
onClose={onClose}
strategy={'fixed'}
matchWidth
// matchWidth
>
<MenuButton
as={Button}
@@ -191,6 +185,9 @@ const MySelect = <T = any,>(
size={'md'}
fontSize={'sm'}
textAlign={'left'}
h={'auto'}
whiteSpace={'pre-wrap'}
wordBreak={'break-word'}
_active={{
transform: 'none'
}}
@@ -239,7 +236,7 @@ const MySelect = <T = any,>(
<MenuList
ref={MenuListRef}
className={props.className}
minW={(() => {
w={(() => {
const w = ButtonRef.current?.clientWidth;
if (w) {
return `${w}px !important`;
@@ -248,7 +245,6 @@ const MySelect = <T = any,>(
? width.map((item) => `${item} !important`)
: `${width} !important`;
})()}
w={'auto'}
px={'6px'}
py={'6px'}
border={'1px solid #fff'}