diff --git a/src/components/TextInput/utils.ts b/src/components/TextInput/utils.ts index 6d3c2b02f6..2bb202316c 100644 --- a/src/components/TextInput/utils.ts +++ b/src/components/TextInput/utils.ts @@ -429,7 +429,7 @@ export const getFilledTextInputData = ( Platform.OS === 'web' && { outlineStyle: 'none' as const, }, - isDisabled && styles.disabled, + isDisabled && Platform.OS !== 'android' && styles.disabled, inputStyleOverride, ]; @@ -550,7 +550,7 @@ export const getOutlinedTextInputData = ( Platform.OS === 'web' && { outlineStyle: 'none' as const, }, - isDisabled && styles.disabled, + isDisabled && Platform.OS !== 'android' && styles.disabled, inputStyleOverride, ]; diff --git a/src/components/__tests__/TextInput.test.tsx b/src/components/__tests__/TextInput.test.tsx index fa1f39b695..b8bb8a1c32 100644 --- a/src/components/__tests__/TextInput.test.tsx +++ b/src/components/__tests__/TextInput.test.tsx @@ -653,6 +653,40 @@ it('applies disabled opacity to the TextInput when disabled is true (outlined)', }); }); +it('does not apply extra disabled opacity to the TextInput on Android', async () => { + const platformOS = jest.replaceProperty(Platform, 'OS', 'android'); + try { + await render( + <> + {}} + disabled + testID="tf-input-dis-android" + /> + {}} + disabled + testID="tf-input-dis-out-android" + /> + + ); + + expect(screen.getByTestId('tf-input-dis-android')).not.toHaveStyle({ + opacity: stateOpacity.disabled, + }); + expect(screen.getByTestId('tf-input-dis-out-android')).not.toHaveStyle({ + opacity: stateOpacity.disabled, + }); + } finally { + platformOS.restore(); + } +}); + it('forwards TextInput props such as testID', async () => { await render(