Skip to content

Commit 6f1ef2f

Browse files
authored
Picker - spread others props to TextField instead of extracting manually (#1895)
1 parent 083acc7 commit 6f1ef2f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/components/picker/new.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ const Picker = (props: PropsWithChildren<PickerProps> & ForwardRefInjectedProps
5454
pickerModalProps,
5555
listProps,
5656
value,
57-
editable,
5857
getLabel,
5958
getItemLabel,
6059
getItemValue,
6160
renderItem,
6261
children,
6362
migrate,
64-
migrateTextField
63+
migrateTextField,
64+
...others
6565
} = props;
6666

6767
const [selectedItemPosition, setSelectedItemPosition] = useState(0);
@@ -125,7 +125,7 @@ const Picker = (props: PropsWithChildren<PickerProps> & ForwardRefInjectedProps
125125
onDoneSelecting
126126
]);
127127

128-
const textInputProps = TextField.extractOwnProps(props);
128+
// const textInputProps = TextField.extractOwnProps(props);
129129
const {paddings, margins, positionStyle} = modifiers;
130130

131131
const modalProps: ExpandableOverlayProps['modalProps'] = {
@@ -208,7 +208,7 @@ const Picker = (props: PropsWithChildren<PickerProps> & ForwardRefInjectedProps
208208
onPress={onPress}
209209
testID={testID}
210210
{...customPickerProps}
211-
disabled={editable === false}
211+
disabled={props.editable === false}
212212
>
213213
{renderPicker ? (
214214
// @ts-expect-error TS throws a weird error, might be an issue with TS
@@ -218,7 +218,8 @@ const Picker = (props: PropsWithChildren<PickerProps> & ForwardRefInjectedProps
218218
migrate={migrateTextField}
219219
customWarning="RNUILib Picker component's internal TextField will soon be replaced with a new implementation, in order to start the migration - please pass to Picker the 'migrateTextField' prop"
220220
ref={forwardedRef}
221-
{...textInputProps}
221+
// {...textInputProps}
222+
{...others}
222223
testID={`${testID}.input`}
223224
containerStyle={[paddings, margins, positionStyle, containerStyle]}
224225
{...accessibilityInfo}

0 commit comments

Comments
 (0)