|
3 | 3 | @use '../core/style/vendor-prefixes'; |
4 | 4 |
|
5 | 5 | $fallbacks: m3-form-field.get-tokens(); |
6 | | - |
7 | | -// TODO(b/263527625): should be removed when this is addressed on the MDC side. |
8 | | -// MDC sets a will-change on this element, because of the animation. This can cause |
9 | | -// scrolling performance degradation on pages with a lot of form fields so we reset it. |
10 | | -// The animation is on a `transform` which is hardware-accelerated already. |
11 | | -// This flag is used to re-add the `will-change` internally since removing it causes a |
12 | | -// lot of screenshot diffs. |
13 | | -$_enable-form-field-will-change-reset: true; |
| 6 | +$_is-external-build: true; |
14 | 7 |
|
15 | 8 | // Mixin that can be included to override the default MDC text-field |
16 | 9 | // styles to fit our needs. See individual comments for context on why |
@@ -45,7 +38,13 @@ $_enable-form-field-will-change-reset: true; |
45 | 38 | // clicking the label to focus the input. |
46 | 39 | pointer-events: all; |
47 | 40 |
|
48 | | - @if ($_enable-form-field-will-change-reset) { |
| 41 | + // TODO(b/263527625): should be removed when this is addressed on the MDC side. |
| 42 | + // MDC sets a will-change on this element, because of the animation. This can cause |
| 43 | + // scrolling performance degradation on pages with a lot of form fields so we reset it. |
| 44 | + // The animation is on a `transform` which is hardware-accelerated already. |
| 45 | + // This flag is used to re-add the `will-change` internally since removing it causes a |
| 46 | + // lot of screenshot diffs. |
| 47 | + @if ($_is-external-build) { |
49 | 48 | will-change: auto; |
50 | 49 | } |
51 | 50 | } |
@@ -81,7 +80,8 @@ $_enable-form-field-will-change-reset: true; |
81 | 80 | height: auto; |
82 | 81 | flex: auto; |
83 | 82 |
|
84 | | - @if ($_enable-form-field-will-change-reset) { |
| 83 | + // TODO(b/263527625): should be removed when this is addressed on the MDC side. |
| 84 | + @if ($_is-external-build) { |
85 | 85 | will-change: auto; |
86 | 86 | } |
87 | 87 | } |
|
0 commit comments