|
393 | 393 | } |
394 | 394 | } |
395 | 395 |
|
| 396 | + @if $variant == 'material' { |
| 397 | + %form-group-display--border { |
| 398 | + &:has(input:-webkit-autofill, input:autofill) { |
| 399 | + %igx-input-group__notch--border { |
| 400 | + border-block-start-color: transparent; |
| 401 | + } |
| 402 | + |
| 403 | + %form-group-label { |
| 404 | + --label-position: #{sizable(18px, 22px, 26px)}; |
| 405 | + |
| 406 | + transform: translateY(calc(var(--label-position) * -1)); |
| 407 | + margin-top: 0; |
| 408 | + overflow: hidden; |
| 409 | + will-change: font-size, color, transform; |
| 410 | + } |
| 411 | + } |
| 412 | + } |
| 413 | + } |
| 414 | + |
396 | 415 | %form-group-display--box { |
397 | 416 | %form-group-border { |
398 | 417 | margin-bottom: 0; |
|
463 | 482 | --size: var(--input-icon) !important; |
464 | 483 | } |
465 | 484 | } |
| 485 | + |
| 486 | + @if $variant == 'material' { |
| 487 | + &:not(%form-group-display--border) { |
| 488 | + &:has(input:-webkit-autofill, input:autofill) { |
| 489 | + %form-group-label { |
| 490 | + --floating-label-position: -73%; |
| 491 | + |
| 492 | + @include type-style('caption'); |
| 493 | + |
| 494 | + transform: translateY(var(--floating-label-position)); |
| 495 | + } |
| 496 | + } |
| 497 | + } |
| 498 | + } |
466 | 499 | } |
467 | 500 |
|
468 | 501 | %form-group-placeholder { |
|
1179 | 1212 | } |
1180 | 1213 | } |
1181 | 1214 |
|
1182 | | - %chrome-autofill-fix { |
| 1215 | + // This is a hack that removes the autofill background and it's essential, |
| 1216 | + // otherwise the background is on top of the floating label in material theme. |
| 1217 | + // The !important flag is because bootstrap theme(and potentially feature themes) is overriding the transition delay. |
| 1218 | + %autofill-background-fix { |
1183 | 1219 | &:-webkit-autofill, |
1184 | 1220 | &:-webkit-autofill:hover, |
1185 | 1221 | &:-webkit-autofill:focus, |
1186 | | - &:-webkit-autofill:active { |
1187 | | - -webkit-transition-delay: 99999s; |
1188 | | - transition-delay: 99999s; |
| 1222 | + &:-webkit-autofill:active, |
| 1223 | + &:autofill, |
| 1224 | + &:autofill:hover, |
| 1225 | + &:autofill:focus, |
| 1226 | + &:autofill:active, { |
| 1227 | + -webkit-transition-delay: 99999s !important; |
| 1228 | + transition-delay: 99999s !important; |
1189 | 1229 | } |
1190 | 1230 | } |
1191 | 1231 |
|
|
1980 | 2020 | map.get($bootstrap-inline-padding, 'cosy'), |
1981 | 2021 | map.get($bootstrap-inline-padding, 'comfortable') |
1982 | 2022 | ); |
1983 | | - transition: box-shadow .15s ease-out, border .15s ease-out; |
| 2023 | + } |
| 2024 | + |
| 2025 | + // The :not selector is needed otherwise bootstrap will override the %autofill-background-fix |
| 2026 | + %form-group-display--bootstrap { |
| 2027 | + :not(:has(input:-webkit-autofill, input:autofill)) { |
| 2028 | + %bootstrap-input { |
| 2029 | + transition: box-shadow .15s ease-out, border .15s ease-out; |
| 2030 | + } |
| 2031 | + } |
1984 | 2032 | } |
1985 | 2033 |
|
1986 | 2034 | %bootstrap-input, |
|
0 commit comments