Skip to content

Picker - spread others props to TextField instead of extracting manually #1895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/components/picker/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ const Picker = (props: PropsWithChildren<PickerProps> & ForwardRefInjectedProps
pickerModalProps,
listProps,
value,
editable,
getLabel,
getItemLabel,
getItemValue,
renderItem,
children,
migrate,
migrateTextField
migrateTextField,
...others
} = props;

const [selectedItemPosition, setSelectedItemPosition] = useState(0);
Expand Down Expand Up @@ -125,7 +125,7 @@ const Picker = (props: PropsWithChildren<PickerProps> & ForwardRefInjectedProps
onDoneSelecting
]);

const textInputProps = TextField.extractOwnProps(props);
// const textInputProps = TextField.extractOwnProps(props);
const {paddings, margins, positionStyle} = modifiers;

const modalProps: ExpandableOverlayProps['modalProps'] = {
Expand Down Expand Up @@ -208,7 +208,7 @@ const Picker = (props: PropsWithChildren<PickerProps> & ForwardRefInjectedProps
onPress={onPress}
testID={testID}
{...customPickerProps}
disabled={editable === false}
disabled={props.editable === false}
>
{renderPicker ? (
// @ts-expect-error TS throws a weird error, might be an issue with TS
Expand All @@ -218,7 +218,8 @@ const Picker = (props: PropsWithChildren<PickerProps> & ForwardRefInjectedProps
migrate={migrateTextField}
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"
ref={forwardedRef}
{...textInputProps}
// {...textInputProps}
{...others}
testID={`${testID}.input`}
containerStyle={[paddings, margins, positionStyle, containerStyle]}
{...accessibilityInfo}
Expand Down