Skip to content

Disable panning in native picker dialogs #1071

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 3 commits into from
Dec 13, 2020
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion src/components/picker/PickerDialog.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ class PickerDialog extends BaseComponent {

render() {
const dialogProps = extractComponentProps(Dialog, this.props);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.props already contains panDirection as null, passed from NativePicker.
For some reason extractComponentProps not populating it when spreading passed props

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I missed that.
It should have already worked.
Checking...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed (kinda)

// TODO: should be taken from dialogProps but there's an issue with "babel-plugin-typescript-to-proptypes" plugin
const {panDirection} = this.props;
return (
<Dialog {...dialogProps} migrate height="50%" width="77%">
<Dialog {...dialogProps} migrate height="50%" width="77%" panDirection={panDirection}>
<View style={styles.dialog}>
{this.renderHeader()}
<View flex center paddingH-24>
Expand Down
4 changes: 3 additions & 1 deletion src/components/picker/PickerDialog.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ class PickerDialog extends BaseComponent {

render() {
const dialogProps = extractComponentProps(Dialog, this.props);
// TODO: should be taken from dialogProps but there's an issue with "babel-plugin-typescript-to-proptypes" plugin
const {panDirection} = this.props;
return (
<Dialog {...dialogProps} height={250} width="100%" migrate bottom animationConfig={{duration: 300}}>
<Dialog {...dialogProps} height={250} width="100%" migrate bottom animationConfig={{duration: 300}} panDirection={panDirection}>
<View flex bg-white>
{this.renderHeader()}
<View centerV flex>
Expand Down