|
1 | 1 | @import './index'; |
2 | 2 |
|
| 3 | +@select-overflow-prefix-cls: ~'@{select-prefix-cls}-selection-overflow'; |
3 | 4 | @select-multiple-item-border-width: 1px; |
4 | 5 |
|
5 | 6 | @select-multiple-padding: max( |
|
13 | 14 | * since chrome may update to redesign with its align logic. |
14 | 15 | */ |
15 | 16 |
|
| 17 | +// =========================== Overflow =========================== |
| 18 | +.@{select-overflow-prefix-cls} { |
| 19 | + position: relative; |
| 20 | + display: flex; |
| 21 | + flex: auto; |
| 22 | + flex-wrap: wrap; |
| 23 | + max-width: 100%; |
| 24 | + |
| 25 | + &-item { |
| 26 | + flex: none; |
| 27 | + align-self: center; |
| 28 | + max-width: 100%; |
| 29 | + } |
| 30 | +} |
| 31 | + |
16 | 32 | .@{select-prefix-cls} { |
17 | 33 | &-multiple { |
18 | 34 | // ========================= Selector ========================= |
19 | 35 | .@{select-prefix-cls}-selector { |
20 | | - .select-selector(); |
21 | | - .select-search-input-without-border(); |
22 | | - |
23 | 36 | display: flex; |
24 | 37 | flex-wrap: wrap; |
25 | 38 | align-items: center; |
|
59 | 72 |
|
60 | 73 | height: @select-multiple-item-height; |
61 | 74 | margin-top: @select-multiple-item-spacing-half; |
62 | | - margin-right: @input-padding-vertical-base; |
63 | 75 | margin-bottom: @select-multiple-item-spacing-half; |
64 | | - padding: 0 (@padding-xs / 2) 0 @padding-xs; |
65 | 76 | line-height: @select-multiple-item-height - @select-multiple-item-border-width * 2; |
66 | 77 | background: @select-selection-item-bg; |
67 | 78 | border: 1px solid @select-selection-item-border-color; |
68 | 79 | border-radius: @border-radius-base; |
69 | 80 | cursor: default; |
70 | 81 | transition: font-size 0.3s, line-height 0.3s, height 0.3s; |
71 | 82 | user-select: none; |
| 83 | + margin-inline-end: @input-padding-vertical-base; |
| 84 | + padding-inline-start: @padding-xs; |
| 85 | + padding-inline-end: (@padding-xs / 2); |
72 | 86 |
|
73 | 87 | .@{select-prefix-cls}-disabled& { |
74 | 88 | color: @select-multiple-item-disabled-color; |
|
81 | 95 | display: inline-block; |
82 | 96 | margin-right: (@padding-xs / 2); |
83 | 97 | overflow: hidden; |
84 | | - white-space: nowrap; |
| 98 | + white-space: pre; // fix whitespace wrapping. custom tags display all whitespace within. |
85 | 99 | text-overflow: ellipsis; |
86 | 100 | } |
87 | 101 |
|
|
90 | 104 | display: inline-block; |
91 | 105 | color: @text-color-secondary; |
92 | 106 | font-weight: bold; |
93 | | - font-size: @font-size-sm; |
| 107 | + font-size: 10px; |
94 | 108 | line-height: inherit; |
95 | 109 | cursor: pointer; |
96 | | - .iconfont-size-under-12px(10px); |
97 | 110 |
|
98 | 111 | > .@{iconfont-css-prefix} { |
99 | 112 | vertical-align: -0.2em; |
|
106 | 119 | } |
107 | 120 |
|
108 | 121 | // ========================== Input ========================== |
| 122 | + .@{select-overflow-prefix-cls}-item + .@{select-overflow-prefix-cls}-item { |
| 123 | + .@{select-prefix-cls}-selection-search { |
| 124 | + margin-inline-start: 0; |
| 125 | + } |
| 126 | + } |
| 127 | + |
109 | 128 | .@{select-prefix-cls}-selection-search { |
110 | 129 | position: relative; |
111 | | - margin-left: (@select-multiple-padding / 2); |
| 130 | + max-width: 100%; |
| 131 | + margin-top: @select-multiple-item-spacing-half; |
| 132 | + margin-bottom: @select-multiple-item-spacing-half; |
| 133 | + margin-inline-start: @input-padding-horizontal-base - @input-padding-vertical-base; |
112 | 134 |
|
113 | 135 | &-input, |
114 | 136 | &-mirror { |
| 137 | + height: @select-multiple-item-height; |
115 | 138 | font-family: @font-family; |
116 | | - line-height: @line-height-base; |
| 139 | + line-height: @select-multiple-item-height; |
117 | 140 | transition: all 0.3s; |
118 | 141 | } |
119 | 142 |
|
|
127 | 150 | top: 0; |
128 | 151 | left: 0; |
129 | 152 | z-index: 999; |
130 | | - white-space: nowrap; |
| 153 | + white-space: pre; // fix whitespace wrapping caused width calculation bug |
131 | 154 | visibility: hidden; |
132 | 155 | } |
133 | | - |
134 | | - // https://github.com/ant-design/ant-design/issues/22906 |
135 | | - &:first-child .@{select-prefix-cls}-selection-search-input { |
136 | | - margin-left: 6.5px; |
137 | | - } |
138 | 156 | } |
139 | 157 |
|
140 | 158 | // ======================= Placeholder ======================= |
|
166 | 184 | } |
167 | 185 |
|
168 | 186 | .@{select-prefix-cls}-selection-search { |
169 | | - height: @select-selection-height + @select-multiple-padding; |
170 | | - line-height: @select-selection-height + @select-multiple-padding; |
| 187 | + height: @select-selection-height; |
| 188 | + line-height: @select-selection-height; |
171 | 189 |
|
172 | 190 | &-input, |
173 | 191 | &-mirror { |
|
186 | 204 | .@{select-prefix-cls}-selection-placeholder { |
187 | 205 | left: @input-padding-horizontal-sm; |
188 | 206 | } |
189 | | - // https://github.com/ant-design/ant-design/issues/22906 |
190 | | - .@{select-prefix-cls}-selection-search:first-child |
191 | | - .@{select-prefix-cls}-selection-search-input { |
192 | | - margin-left: 3px; |
| 207 | + // https://github.com/ant-design/ant-design/issues/29559 |
| 208 | + .@{select-prefix-cls}-selection-search { |
| 209 | + margin-inline-start: 3px; |
193 | 210 | } |
194 | 211 | } |
195 | 212 | &.@{select-prefix-cls}-lg { |
|
0 commit comments