Skip to content

Feat/new wheel picker integration #1083

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 54 commits into from
Apr 4, 2021
Merged

Conversation

mendyEdri
Copy link
Contributor

@mendyEdri mendyEdri commented Dec 17, 2020

Description

Integrate the new WheelPicker into our Picker when passing useNativePicker prop.

WIP:

  • Unwanted extra space in the WheelPicker when it's under the safeArea.
  • FlatList's initialScrollIndex doesn't work, hacked with timer for now (could be a permanent fix).
  • WheelPicker is not fully controlled; when passing a hard-coded data it still change when scrolling the WheelPicker,
    example: <WheelPicker selectedValue={‘Java’} /> when scrolling, it's not scrolling back to the 'Java' row.
  • Implement and check behaviour on Android.
  • Extract finding index to presenter/other type.
  • add unit test for WheelPicker presenter.

Changelog

Integrate the new customizable WheelPicker into our Picker when passing useNativePicker prop.

@mendyEdri mendyEdri requested a review from ethanshar December 17, 2020 09:33
@ethanshar
Copy link
Collaborator

  • Unwanted extra space in the WheelPicker when it's under the safeArea.

See my comment in the code

  • FlatList's initialScrollIndex doesn't work, hacked with timer for now (could be a permanent fix).

Instead of hacking with setTimeout. Try scrolling to initial index on FlatList's onLayout prop.

  • WheelPicker is not fully controlled; when passing a hard-coded data it still change when scrolling the WheelPicker,
    example: <WheelPicker selectedValue={‘Java’} /> when scrolling, it's not scrolling back to the 'Java' row.

I don't think WheelPicker can ever be fully controlled because of the way users interact with it.
We can't have the wheel's value to wait for prop change, the interaction is too fast - so it must be uncontrolled in that way.
Having said that, the dialog picker can be controlled. cause the final value is determined only when pressing 'done'.

@mendyEdri
Copy link
Contributor Author

mendyEdri commented Dec 22, 2020

the dialog picker can be

Agree, user interaction can constantly change the value.
though, I tried to mimic the current behaviour of WheelPicker, that was re-scrolling to value if it was controlled, so is it ok that the behaviour will differ?
2nd: when w'll have a few pickers, wi'll need a way to control the value.
(ex: min to max, max can't be lower then min)

@ethanshar
Copy link
Collaborator

the dialog picker can be

Agree, user interaction can constantly change the value.
though, I tried to mimic the current behaviour of WheelPicker, that was re-scrolling to value if it was controlled, so is it ok that the behaviour will differ?
2nd: when w'll have a few pickers, wi'll need a way to control the value.
(ex: min to max, max can't be lower then min)

I see what you mean..
I believe you want to treat the value prop as an initialValue and if the user change it in runtime it will reset to that value, right?

@mendyEdri
Copy link
Contributor Author

and if the user change it in runtime it will reset to that value,

right. we probably going to need it

@mendyEdri mendyEdri removed the pending label Jan 19, 2021
@ethanshar
Copy link
Collaborator

@mendyEdri
The reason this is pending is because we wanted to check it on a real one app version, right?
Did we tested on one app after the onChange fixes?

Copy link
Collaborator

@ethanshar ethanshar left a comment

Choose a reason for hiding this comment

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

Approving, don't merge yet.
Let's figure how we want to rollout this feature carefully.

@mendyEdri
Copy link
Contributor Author

@mendyEdri
The reason this is pending is because we wanted to check it on a real one app version, right?
Did we tested on one app after the onChange fixes?

@ethanshar, exactly. i've added in the jira-ticket the relevant one-app version with this fix :)

@mendyEdri mendyEdri removed the pending label Mar 14, 2021
@mendyEdri
Copy link
Contributor Author

@mendyEdri
The reason this is pending is because we wanted to check it on a real one app version, right?
Did we tested on one app after the onChange fixes?

@ethanshar, exactly. i've added in the jira-ticket the relevant one-app version with this fix :)

Approving, don't merge yet.
Let's figure how we want to rollout this feature carefully.

@ethanshar, We have UX approval for including it without haptic (yet).
Can I merge?

@mendyEdri mendyEdri merged commit 1ee09ba into master Apr 4, 2021
@mendyEdri mendyEdri deleted the feat/new-wheel-picker-integration branch April 5, 2021 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants