Skip to content

fix(autocomplete): autocomplete component defaults to 100% of the width #3462

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
May 27, 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
7 changes: 5 additions & 2 deletions packages/theme-saas/src/autocomplete/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.@{autocomplete-prefix-cls} {
@apply relative;
@apply inline-block;
@apply w-full;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that applying w-full does not conflict with other styles or cause layout issues in different contexts.


&.show-auto-width {
@apply w-full;
Expand All @@ -30,7 +31,8 @@
}

// 兼容ie10-ie11
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
@media screen and (-ms-high-contrast: active),
(-ms-high-contrast: none) {
&__wrap {
margin-bottom: -17px !important;
@apply ~'pb-1.5';
Expand Down Expand Up @@ -69,6 +71,7 @@
}

&:only-of-type {

&,
&:hover {
@apply bg-color-bg-3;
Expand Down Expand Up @@ -108,4 +111,4 @@
@apply ~'mt-0.5';
}
}
}
}
3 changes: 2 additions & 1 deletion packages/theme/src/autocomplete/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
.@{autocomplete-prefix-cls} {
position: relative;
display: inline-block;
width: 100%;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that setting width: 100% does not conflict with other styles or cause layout issues in different contexts.


&.show-auto-width {
width: 100%;
Expand Down Expand Up @@ -75,4 +76,4 @@
}
}
}
}
}
Loading