Skip to content

Commit ddd50fe

Browse files
author
undefined
committed
fix: input style error #3073
1 parent 41a0251 commit ddd50fe

File tree

4 files changed

+58
-19
lines changed

4 files changed

+58
-19
lines changed

components/form/style/index.less

+7-18
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,8 @@ form {
464464
}
465465
}
466466

467-
.has-error {
467+
.has-error,
468+
&-has-error {
468469
.form-control-validation(@error-color; @error-color; @form-error-input-bg;);
469470

470471
&.has-feedback .@{form-prefix-cls}-item-children-icon {
@@ -473,15 +474,12 @@ form {
473474
}
474475

475476
//select
476-
.@{ant-prefix}-select {
477-
&-selection {
478-
border-color: @error-color;
479-
&:hover {
480-
border-color: @error-color;
481-
}
477+
.@{ant-prefix}-select:not(.@{ant-prefix}-select-borderless) {
478+
.@{ant-prefix}-select-selector {
479+
border-color: @error-color !important;
482480
}
483-
&-open .@{ant-prefix}-select-selection,
484-
&-focused .@{ant-prefix}-select-selection {
481+
&.@{ant-prefix}-select-open .@{ant-prefix}-select-selector,
482+
&.@{ant-prefix}-select-focused .@{ant-prefix}-select-selector {
485483
.active(@error-color);
486484
}
487485
}
@@ -499,15 +497,6 @@ form {
499497
}
500498
}
501499

502-
// arrow and icon
503-
.@{ant-prefix}-calendar-picker-icon::after,
504-
.@{ant-prefix}-time-picker-icon::after,
505-
.@{ant-prefix}-picker-icon::after,
506-
.@{ant-prefix}-select-arrow,
507-
.@{ant-prefix}-cascader-picker-arrow {
508-
color: @error-color;
509-
}
510-
511500
//input-number, timepicker
512501
.@{ant-prefix}-input-number,
513502
.@{ant-prefix}-time-picker-input {

components/form/style/mixin.less

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
color: @text-color;
77
}
88
// 输入框的不同校验状态
9-
.@{ant-prefix}-input {
9+
.@{ant-prefix}-input,
10+
.@{ant-prefix}-input-affix-wrapper {
1011
&,
1112
&:hover {
1213
background-color: @background-color;

components/input/style/affix.less

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
@import './index';
2+
@import './mixin';
3+
4+
@input-affix-margin: 4px;
5+
6+
.@{ant-prefix}-input {
7+
&-affix-wrapper {
8+
.input();
9+
display: inline-flex;
10+
11+
&-disabled {
12+
.@{ant-prefix}-input[disabled] {
13+
background: transparent;
14+
}
15+
}
16+
17+
> input.@{ant-prefix}-input {
18+
padding: 0;
19+
border: none;
20+
outline: none;
21+
22+
&:focus {
23+
box-shadow: none;
24+
}
25+
}
26+
27+
&::before {
28+
width: 0;
29+
visibility: hidden;
30+
content: '\a0';
31+
}
32+
}
33+
34+
&-prefix,
35+
&-suffix {
36+
display: flex;
37+
flex: none;
38+
align-items: center;
39+
}
40+
41+
&-prefix {
42+
margin-right: @input-affix-margin;
43+
}
44+
45+
&-suffix {
46+
margin-left: @input-affix-margin;
47+
}
48+
}

components/input/style/index.less

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import '../../style/themes/index';
22
@import '../../style/mixins/index';
3+
@import './affix';
34
@import './mixin';
45

56
// Input styles

0 commit comments

Comments
 (0)