Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
  • Loading branch information
shenjunjian committed Jun 9, 2025
commit b9280c26ae2a1546ff11c94ca0b968a7e48ea520
27 changes: 11 additions & 16 deletions packages/theme-saas/src/select-dropdown/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@popper-prefix-cls: ~'@{css-prefix}popper';
@scrollbar-prefix-cls: ~'@{css-prefix}scrollbar';
@recycle-scroller-prefix-cls: ~'@{css-prefix}recycle-scroller';
@select-dropdown__item-prefix-cls:~'@{css-prefix}select-dropdown__item';
@select-dropdown__item-prefix-cls: ~'@{css-prefix}select-dropdown__item';

.@{select-dropdown-prefix-cls} {
@apply absolute;
Expand Down Expand Up @@ -37,15 +37,15 @@
}
}

& .@{recycle-scroller-prefix-cls}{
& .@{recycle-scroller-prefix-cls} {
list-style: none;

.@{select-dropdown__item-prefix-cls}{
.@{select-dropdown__item-prefix-cls} {
margin-right: 0
}

&__slot{
.tiny-select-dropdown__item{
&__slot {
.tiny-select-dropdown__item {
margin-bottom: 0;
}
}
Expand All @@ -58,6 +58,7 @@
@apply text-color-text-secondary;
@apply text-xs;
}

// tiny 新增
.@{select-dropdown-prefix-cls}__empty-images {
background-image: url('../images/empty-nodata.png');
Expand Down Expand Up @@ -88,31 +89,25 @@
@apply m-1;
@apply rounded;

> .tiny-svg,
> span > .tiny-svg {
>.tiny-svg,
>span>.tiny-svg {
@apply ~'-mt-0.5';
}
&:first-child {
> .tiny-svg,
> span > .tiny-svg {
margin-top: 1px
}
}
}

& &__loading {
@apply text-center;
@apply ~'py-2.5 px-0';

> .circular {
>.circular {
@apply fill-color-brand;
@apply h-4;
@apply w-4;
animation: loading-rotate 2s linear infinite;
@apply inline-block;
@apply align-top;

circle{
circle {
animation: loading-dash 1.5s ease-in-out infinite;
stroke-dasharray: 90, 150;
stroke-dashoffset: 0;
Expand Down Expand Up @@ -170,4 +165,4 @@
stroke-dasharray: 90, 150;
stroke-dashoffset: -120px;
}
}
}
16 changes: 12 additions & 4 deletions packages/vue/src/select/src/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,12 @@
@mousedown.stop
@mouseenter="state.hoverIndex = -9"
>
<component :is="`icon-${state.selectCls}`" :class="['tiny-svg-size', state.selectCls]" />
<span>{{ allText || t('ui.base.all') }}</span>
<span class="tiny-option__checkbox-wrap tiny-select-dropdown__item-checkbox">
<component :is="`icon-${state.selectCls}`" :class="['tiny-svg-size', state.selectCls]"
/></span>
<div class="tiny-option-wrapper calc-width">
<span class="tiny-option-label">{{ allText || t('ui.base.all') }}</span>
</div>
</li>
<li
v-if="
Expand All @@ -521,8 +525,12 @@
@mousedown.stop
@mouseenter="state.hoverIndex = -9"
>
<component :is="`icon-${state.filteredSelectCls}`" :class="['tiny-svg-size', state.filteredSelectCls]" />
<span>{{ allText || t('ui.base.all') }}</span>
<span class="tiny-option__checkbox-wrap tiny-select-dropdown__item-checkbox">
<component :is="`icon-${state.filteredSelectCls}`" :class="['tiny-svg-size', state.filteredSelectCls]"
/></span>
<div class="tiny-option-wrapper calc-width">
<span class="tiny-option-label">{{ allText || t('ui.base.all') }}</span>
</div>
</li>
<tiny-option :value="state.query" created v-if="state.showNewOption"> </tiny-option>
<slot>
Expand Down
Loading