@@ -15,16 +15,16 @@ import {
1515} from '../constants' ;
1616import {
1717 $disabledStyle ,
18- $supportingTextStyle ,
1918 $inputStyle ,
2019 $leadingAccessoryStyle ,
20+ $supportingTextStyle ,
2121 $trailingAccessoryStyle ,
2222} from '../styles' ;
2323import type { TextFieldProps , TextFieldSharedApi } from '../TextField' ;
2424import {
2525 getFieldBackgroundColor ,
26- getSupportingTextColor ,
2726 getLabelColor ,
27+ getSupportingTextColor ,
2828} from '../utils' ;
2929import {
3030 LABEL_LEFT_OFFSET_WITH_ACCESSORY ,
@@ -36,6 +36,7 @@ import {
3636 $fieldStyle ,
3737 $labelTextStyle ,
3838 $labelWrapperStyle ,
39+ $disabledBackgroundStyle ,
3940 $outlineStyle ,
4041} from './styles' ;
4142import { getOutlineColor } from './utils' ;
@@ -145,12 +146,25 @@ export const getFilledTextFieldData = (
145146 $fieldStyleOverride ,
146147 ] ;
147148
149+ /* Disabled tint (`onSurface @ 0.04`) is rendered as a childless overlay so its
150+ alpha can be applied via the `opacity` style without leaking onto the label
151+ and input. The View accepts `PlatformColor` directly. */
152+ const $disabledBackgroundStyles : StyleProp < ViewStyle > = disabled
153+ ? [
154+ $disabledBackgroundStyle ,
155+ {
156+ backgroundColor : onSurface ,
157+ } ,
158+ ]
159+ : undefined ;
160+
148161 const $outlineStyles = [
149162 $outlineStyle ,
150163 {
151164 height : INACTIVE_INDICATOR_SIZE ,
152165 backgroundColor : outlineColor ,
153166 } ,
167+ disabled && $disabledStyle ,
154168 ] ;
155169
156170 const $animatedActiveOutlineStyles : StyleProp <
@@ -161,6 +175,7 @@ export const getFilledTextFieldData = (
161175 height : ACTIVE_INDICATOR_SIZE ,
162176 backgroundColor : activeOutlineColor ,
163177 } ,
178+ disabled && $disabledStyle ,
164179 $animatedActiveOutlineStyle ,
165180 ] ;
166181
@@ -231,6 +246,7 @@ export const getFilledTextFieldData = (
231246 $animatedLabelTextStyles,
232247 $animatedPlaceholderStyles,
233248 $fieldStyles,
249+ $disabledBackgroundStyles,
234250 $outlineStyles,
235251 $animatedActiveOutlineStyles,
236252 $containerStyles,
0 commit comments