Skip to content
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

Picker component is inconsistent between iOS and Android #25866

Closed
dkniffin opened this issue Jul 29, 2019 · 9 comments
Closed

Picker component is inconsistent between iOS and Android #25866

dkniffin opened this issue Jul 29, 2019 · 9 comments
Labels
DX Issues concerning how the developer experience can be improved. Impact: Platform Disparity Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@dkniffin
Copy link

dkniffin commented Jul 29, 2019

I am confused about the intended usage of the Picker component. As it is now, it is very inconsistent in behavior between iOS and Android.

To illustrate this, I've created a small component:

const PickerDummyPage = () => {
  return (
    <>
      <Text style={{ color: 'black' }}>Pick your item...</Text>
      <Picker prompt="Picker" selectedValue="Foo" style={{ backgroundColor: 'gray' }} >
        <Picker.Item value="Foo" label="Foo" />
        <Picker.Item value="Bar" label="Bar" />
      </Picker>
    </>
  )
}

Here is how it renders on iOS:

Screen Shot 2019-07-29 at 1 30 35 PM

and here it is on Android:

Screen Shot 2019-07-29 at 1 30 59 PM

Ignoring my atrocious styling here, the point I'm trying to get across is that the picker is very different between the two.

What I'm looking for is an easy way to have a dropdown-like field (similar to select on web), that behaves in a way that feels native to each platform. For Android, that seems to be the case, but for iOS, I would expect that it would render as an empty field, and when the field is clicked, it would open up a keyboard-like dialog prompt with the picker rendered inside it.

For reference, here's what a select field renders like in Safari (rendering this page), which is exactly the behavior I'm expecting:

Screen Shot 2019-07-29 at 1 37 05 PM

Screen Shot 2019-07-29 at 1 39 28 PM

For now, my workaround is going to be to use a 3rd party library, but this definitely feels like something that should work out of the box in react-native.

React Native version:

info
  React Native Environment Info:
    System:
      OS: macOS 10.14.5
      CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
      Memory: 64.58 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 11.14.0 - ~/.asdf/installs/nodejs/11.14.0/bin/node
      Yarn: 1.15.2 - ~/.asdf/installs/nodejs/11.14.0/.npm/bin/yarn
      npm: 6.7.0 - ~/.asdf/installs/nodejs/11.14.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
      Android SDK:
        API Levels: 26, 27, 28
        Build Tools: 27.0.3, 28.0.3
        System Images: android-24 | Google Play Intel x86 Atom, android-27 | Intel x86 Atom_64, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5199772
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      react: ^16.6.3 => 16.8.6
    npmGlobalPackages:
      react-native-cli: 2.0.1
@dkniffin dkniffin added the Bug label Jul 29, 2019
@ecexplorer
Copy link

The date pickers also have quite different behaviors. At least in this case, they are separate components.

@react-native-bot
Copy link
Collaborator

Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

👉 Click here if you want to take another look at the Bug Report issue template.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: Needs More Information labels Jul 29, 2019
@dkniffin
Copy link
Author

@react-native-bot updated to include RN version. Not sure what else I need to include

@stale
Copy link

stale bot commented Oct 27, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 27, 2019
@dkniffin
Copy link
Author

I don't know how to implement this, nor do I have time to, but it looks like I'm not the only one with this opinion, so I'd like to hear from someone from the RN team about whether this is something they would accept. If so, I'd recommend someone create a PR in order to get it moving forward.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 28, 2019
@hramos hramos added Needs: Author Feedback Needs: Issue Template This issue does not make use of the Issue Template, and may be missing necessary information. Needs: Triage 🔍 and removed Resolution: Needs More Information Needs: Author Feedback labels Jan 18, 2020
@safaiyeh
Copy link
Contributor

hi @dkniffin we need some more information.

Could you do a few things:
• verify this happens on the latest version.
• Create a snack or reproducible demo that displays the bug
• follow the issue template

@safaiyeh safaiyeh added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available and removed Component: Picker Needs: Triage 🔍 Platform: Android Android applications. Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. labels Mar 20, 2020
@dkniffin
Copy link
Author

dkniffin commented Mar 24, 2020

@safaiyeh I'm not actually working on any RN projects at this time. If anyone else following this thread wants to take this over for me, that would be awesome! I know this would make development of basic forms a bit easier. Essentially what I'm asking for is for something like https://github.com/lawnstarter/react-native-picker-select to become part of the standard RN library.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Mar 24, 2020
@hramos hramos added Component: Picker DX Issues concerning how the developer experience can be improved. Impact: Platform Disparity and removed Bug Needs: Attention Issues where the author has responded to feedback. Needs: Issue Template This issue does not make use of the Issue Template, and may be missing necessary information. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available labels Mar 24, 2020
@stale
Copy link

stale bot commented Jun 23, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 23, 2020
@stale
Copy link

stale bot commented Jul 3, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jul 3, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Jul 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
DX Issues concerning how the developer experience can be improved. Impact: Platform Disparity Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

5 participants