fix: 修复 select 样式问题 (#4447)

* fix: 修复 select 样式问题

* 更新单测
This commit is contained in:
RickCole 2022-05-25 19:58:20 +08:00 committed by GitHub
parent 49509a712b
commit 2802ef5ef0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 13 deletions

View File

@ -210,7 +210,7 @@ exports[`Renderer:repeat 1`] = `
</span>
<div
class="cxd-PopOver cxd-Select-popover cxd-PopOver--leftBottomLeftTop"
style="display: block; min-width: 0; left: 0px; top: 0px; position: relative;"
style="display: block; width: 0px; left: 0px; top: 0px; position: relative;"
theme="cxd"
>
<div
@ -220,7 +220,7 @@ exports[`Renderer:repeat 1`] = `
class="cxd-Select-menu"
>
<div
class="cxd-Select-option invisible"
class="cxd-Select-option hidden"
>
<span>
Placeholder

View File

@ -1572,7 +1572,7 @@ exports[`Renderer:select virtual 1`] = `
</span>
<div
class="cxd-PopOver cxd-Select-popover cxd-PopOver--leftBottomLeftTop"
style="display: block; min-width: 0; left: 0px; top: 0px; position: relative;"
style="display: block; width: 0px; left: 0px; top: 0px; position: relative;"
theme="cxd"
>
<div
@ -1582,7 +1582,7 @@ exports[`Renderer:select virtual 1`] = `
class="cxd-Select-menu cxd-Select--longlist"
>
<div
class="cxd-Select-option invisible"
class="cxd-Select-option hidden"
>
<span>
Placeholder

View File

@ -261,6 +261,7 @@
}
> input {
width: 100%;
outline: none;
border: none;
flex-grow: 1;
@ -272,7 +273,7 @@
&-option {
cursor: pointer;
min-width: px2rem(120px);
// min-width: px2rem(120px);
padding: calc(
(
var(--Form-select-menu-height) - var(--Form-input-lineHeight) *
@ -401,7 +402,7 @@
box-shadow: var(--Form-select-outer-boxShadow);
border-top-left-radius: 0;
border-top-right-radius: 0;
min-width: px2rem(100px);
// min-width: px2rem(100px);
// PopOver 上已经配置了这个要是配置就会覆盖所以先干掉好了
// z-index: 10;

View File

@ -778,10 +778,7 @@ export class Select extends React.Component<SelectProps, SelectState> {
})}
onClick={this.removeItem.bind(this, index)}
>
<Icon
icon="close"
className="icon"
/>
<Icon icon="close" className="icon" />
</span>
</div>
</TooltipWrapper>
@ -1026,7 +1023,7 @@ export class Select extends React.Component<SelectProps, SelectState> {
</div>
) : null}
<div ref={this.menuItemRef} className={cx('Select-option invisible')}>
<div ref={this.menuItemRef} className={cx('Select-option hidden')}>
{multiple ? (
<Checkbox size="sm">Placeholder</Checkbox>
) : (
@ -1083,7 +1080,7 @@ export class Select extends React.Component<SelectProps, SelectState> {
overlay
className={cx('Select-popover')}
style={{
minWidth: this.target ? this.target.offsetWidth : 'auto'
width: this.target ? this.target.offsetWidth : 'auto'
}}
onHide={this.close}
>

View File

@ -202,7 +202,7 @@ register('zh-CN', {
'Select.clearAll': '移除所有',
'Select.createLabel': '新增选项',
'Select.placeholder': '请选择',
'Select.searchPromptText': '输入内容进行检索',
'Select.searchPromptText': '索',
'sort': '排序',
'SubForm.button': '设置',
'SubForm.editDetail': '编辑详情',