From fee47f71cdb040d79d23711a9423786482826f37 Mon Sep 17 00:00:00 2001 From: qkiroc <30946345+qkiroc@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:15:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dselect=E4=B8=8Bmenutpl?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98=20(#1148?= =?UTF-8?q?7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复select下menutpl样式错误问题 (#11484) * style: 优化select下checkbox样式 * 优化 --------- Co-authored-by: Qnets <43038692+hzh11012@users.noreply.github.com> --- .../amis-ui/scss/components/form/_select.scss | 32 +++++++++---------- packages/amis-ui/src/components/Select.tsx | 1 + 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/packages/amis-ui/scss/components/form/_select.scss b/packages/amis-ui/scss/components/form/_select.scss index 4b0518921c9..42122ed5da5 100644 --- a/packages/amis-ui/scss/components/form/_select.scss +++ b/packages/amis-ui/scss/components/form/_select.scss @@ -363,33 +363,33 @@ background: var(--select-base-default-option-bg-color); line-height: var(--select-base-default-option-line-height); - &-checkbox { + .#{$ns}Checkbox { width: 100%; display: flex; + align-items: center; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; - align-items: center; - > label { - width: 100%; - display: flex; + margin: 0; + > i { + flex-shrink: 0; + } + + > span { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; - align-items: center; - - > i { - flex-shrink: 0; - } - - > span { + width: 100%; + font-size: var(--select-base-default-option-fontSize); + font-weight: var(--select-base-default-option-fontWeight); + color: var(--select-base-default-option-color); + } + .#{$ns}TplField { + > span > p { + margin: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; - width: 100%; - font-size: var(--select-base-default-option-fontSize); - font-weight: var(--select-base-default-option-fontWeight); - color: var(--select-base-default-option-color); } } } diff --git a/packages/amis-ui/src/components/Select.tsx b/packages/amis-ui/src/components/Select.tsx index 1c1ae927758..25a17ce97db 100644 --- a/packages/amis-ui/src/components/Select.tsx +++ b/packages/amis-ui/src/components/Select.tsx @@ -1095,6 +1095,7 @@ export class Select extends React.Component { }} disabled={item.disabled} testIdBuilder={optTestIdBudr?.getChild('chekbx')} + size="sm" > {renderMenu(item, { multiple,