Skip to content
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

fix(input): fix overlapping styles of neighboring components in input-group #2889

Merged
merged 3 commits into from
Jan 11, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,16 @@ exports[`<input> demo: render [group] correctly 1`] = `
`;

exports[`<input> demo: render [password] correctly 1`] = `
"<span class=\\"arco-input-wrapper\\" style=\\"width: 320px;\\"><!----><input class=\\"arco-input arco-input-size-medium\\" type=\\"password\\" placeholder=\\"Please enter something\\"><!----><span class=\\"arco-input-suffix\\"><!----><span class=\\"arco-icon-hover\\"><svg viewBox=\\"0 0 48 48\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\" stroke=\\"currentColor\\" class=\\"arco-icon arco-icon-eye-invisible\\" stroke-width=\\"4\\" stroke-linecap=\\"butt\\" stroke-linejoin=\\"miter\\"><path d=\\"M14 14.5c-2.69 2-5.415 5.33-8 9.5 5.373 8.667 11.373 13 18 13 3.325 0 6.491-1.09 9.5-3.271M17.463 12.5C19 11 21.75 11 24 11c6.627 0 12.627 4.333 18 13-1.766 2.848-3.599 5.228-5.5 7.14\\"></path><path d=\\"M29 24a5 5 0 1 1-10 0 5 5 0 0 1 10 0ZM6.852 7.103l34.294 34.294\\"></path></svg></span>
<!----></span></span>"
"<div class=\\"arco-space arco-space-vertical\\">
<!---->
<div class=\\"arco-space-item\\" style=\\"margin-bottom: 24px;\\"><button type=\\"button\\" role=\\"switch\\" aria-checked=\\"true\\" class=\\"arco-switch arco-switch-type-circle arco-switch-checked\\"><span class=\\"arco-switch-handle\\"><span class=\\"arco-switch-handle-icon\\"></span></span><!-- prettier-ignore -->
<!--v-if-->
</button></div>
<!---->
<div class=\\"arco-space-item\\"><span class=\\"arco-input-wrapper\\" style=\\"width: 320px;\\"><!----><input class=\\"arco-input arco-input-size-medium\\" type=\\"password\\" placeholder=\\"Please enter something\\"><!----><span class=\\"arco-input-suffix\\"><!----><span class=\\"arco-icon-hover\\"><svg viewBox=\\"0 0 48 48\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\" stroke=\\"currentColor\\" class=\\"arco-icon arco-icon-eye-invisible\\" stroke-width=\\"4\\" stroke-linecap=\\"butt\\" stroke-linejoin=\\"miter\\"><path d=\\"M14 14.5c-2.69 2-5.415 5.33-8 9.5 5.373 8.667 11.373 13 18 13 3.325 0 6.491-1.09 9.5-3.271M17.463 12.5C19 11 21.75 11 24 11c6.627 0 12.627 4.333 18 13-1.766 2.848-3.599 5.228-5.5 7.14\\"></path><path d=\\"M29 24a5 5 0 1 1-10 0 5 5 0 0 1 10 0ZM6.852 7.103l34.294 34.294\\"></path></svg></span>
<!----></span></span>
</div>
</div>"
`;

exports[`<input> demo: render [prefix] correctly 1`] = `
Expand Down
7 changes: 7 additions & 0 deletions packages/web-vue/components/input/style/group.less
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,11 @@
border-right-color: @input-color-border_focus;
}
}

// 针对Error状态的input边框颜色处理
> .@{input-prefix-cls}-wrapper.@{input-prefix-cls}-error:not(:last-child) {
&:focus-within {
border-right-color: @input-color-border_error_focus;
}
}
}
2 changes: 2 additions & 0 deletions packages/web-vue/components/input/style/input.less
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

&:focus-within,
&.@{cls}-focus {
z-index: 1;
background-color: @input-color-bg_focus;
border-color: @input-color-border_focus;
box-shadow: 0 0 0 @input-size-shadow_focus @input-color-shadow_focus;
Expand Down Expand Up @@ -83,6 +84,7 @@

&.@{cls}-error:focus-within,
&.@{cls}-error&-focus {
z-index: 1;
background-color: @input-color-bg_error_focus;
border-color: @input-color-border_error_focus;
box-shadow: 0 0 0 @input-size-shadow_error_focus
Expand Down