Skip to content

Commit 12be4aa

Browse files
needsTimothée Vialatoux
authored andcommitted
Set <MativeTextInput> editable prop depending on disabled prop (#852)
Co-authored-by: Timothée Vialatoux <[email protected]>
1 parent b9f6cb5 commit 12be4aa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/core/src/components/TextInput.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export interface TextInputProps extends NativeTextInputProps {
1010
webShowOutline?: boolean;
1111
onChangeTextDelayed?: (text: string) => void;
1212
changeTextDelay?: number;
13+
disabled?: boolean;
1314
}
1415

1516
const TextInput = React.forwardRef<NativeTextInput, TextInputProps>(
@@ -19,6 +20,7 @@ const TextInput = React.forwardRef<NativeTextInput, TextInputProps>(
1920
changeTextDelay = 500,
2021
webShowOutline = true,
2122
style,
23+
disabled,
2224
value,
2325
...rest
2426
},
@@ -37,6 +39,7 @@ const TextInput = React.forwardRef<NativeTextInput, TextInputProps>(
3739
testID="native-text-input"
3840
ref={ref}
3941
value={value}
42+
editable={!disabled}
4043
style={[
4144
//@ts-ignore Web specific prop. Removes default blue outline that appears on the hidden TextInput
4245
Platform.OS === "web" && !webShowOutline ? { outlineWidth: 0 } : {},

0 commit comments

Comments
 (0)