Skip to content

Commit 5ee3de3

Browse files
authored
fix(select): modify the DOM structure of all options in the select to be consistent with that of the regular options to solve the text alignment issue (#3488)
1 parent 40d36b5 commit 5ee3de3

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

packages/theme-saas/src/select-dropdown/index.less

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@popper-prefix-cls: ~'@{css-prefix}popper';
77
@scrollbar-prefix-cls: ~'@{css-prefix}scrollbar';
88
@recycle-scroller-prefix-cls: ~'@{css-prefix}recycle-scroller';
9-
@select-dropdown__item-prefix-cls:~'@{css-prefix}select-dropdown__item';
9+
@select-dropdown__item-prefix-cls: ~'@{css-prefix}select-dropdown__item';
1010

1111
.@{select-dropdown-prefix-cls} {
1212
@apply absolute;
@@ -37,15 +37,15 @@
3737
}
3838
}
3939

40-
& .@{recycle-scroller-prefix-cls}{
40+
& .@{recycle-scroller-prefix-cls} {
4141
list-style: none;
4242

43-
.@{select-dropdown__item-prefix-cls}{
43+
.@{select-dropdown__item-prefix-cls} {
4444
margin-right: 0
4545
}
4646

47-
&__slot{
48-
.tiny-select-dropdown__item{
47+
&__slot {
48+
.tiny-select-dropdown__item {
4949
margin-bottom: 0;
5050
}
5151
}
@@ -58,6 +58,7 @@
5858
@apply text-color-text-secondary;
5959
@apply text-xs;
6060
}
61+
6162
// tiny 新增
6263
.@{select-dropdown-prefix-cls}__empty-images {
6364
background-image: url('../images/empty-nodata.png');
@@ -88,31 +89,25 @@
8889
@apply m-1;
8990
@apply rounded;
9091

91-
> .tiny-svg,
92-
> span > .tiny-svg {
92+
>.tiny-svg,
93+
>span>.tiny-svg {
9394
@apply ~'-mt-0.5';
9495
}
95-
&:first-child {
96-
> .tiny-svg,
97-
> span > .tiny-svg {
98-
margin-top: 1px
99-
}
100-
}
10196
}
10297

10398
& &__loading {
10499
@apply text-center;
105100
@apply ~'py-2.5 px-0';
106101

107-
> .circular {
102+
>.circular {
108103
@apply fill-color-brand;
109104
@apply h-4;
110105
@apply w-4;
111106
animation: loading-rotate 2s linear infinite;
112107
@apply inline-block;
113108
@apply align-top;
114109

115-
circle{
110+
circle {
116111
animation: loading-dash 1.5s ease-in-out infinite;
117112
stroke-dasharray: 90, 150;
118113
stroke-dashoffset: 0;
@@ -170,4 +165,4 @@
170165
stroke-dasharray: 90, 150;
171166
stroke-dashoffset: -120px;
172167
}
173-
}
168+
}

packages/vue/src/select/src/pc.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,12 @@
496496
@mousedown.stop
497497
@mouseenter="state.hoverIndex = -9"
498498
>
499-
<component :is="`icon-${state.selectCls}`" :class="['tiny-svg-size', state.selectCls]" />
500-
<span>{{ allText || t('ui.base.all') }}</span>
499+
<span class="tiny-option__checkbox-wrap tiny-select-dropdown__item-checkbox">
500+
<component :is="`icon-${state.selectCls}`" :class="['tiny-svg-size', state.selectCls]"
501+
/></span>
502+
<div class="tiny-option-wrapper calc-width">
503+
<span class="tiny-option-label">{{ allText || t('ui.base.all') }}</span>
504+
</div>
501505
</li>
502506
<li
503507
v-if="
@@ -521,8 +525,12 @@
521525
@mousedown.stop
522526
@mouseenter="state.hoverIndex = -9"
523527
>
524-
<component :is="`icon-${state.filteredSelectCls}`" :class="['tiny-svg-size', state.filteredSelectCls]" />
525-
<span>{{ allText || t('ui.base.all') }}</span>
528+
<span class="tiny-option__checkbox-wrap tiny-select-dropdown__item-checkbox">
529+
<component :is="`icon-${state.filteredSelectCls}`" :class="['tiny-svg-size', state.filteredSelectCls]"
530+
/></span>
531+
<div class="tiny-option-wrapper calc-width">
532+
<span class="tiny-option-label">{{ allText || t('ui.base.all') }}</span>
533+
</div>
526534
</li>
527535
<tiny-option :value="state.query" created v-if="state.showNewOption"> </tiny-option>
528536
<slot>

0 commit comments

Comments
 (0)