question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TimePicker display="spinner" no longer working in RN 64 (Android)

See original GitHub issue

Bug report

Hello!

Summary

Setting display to spinner on the time picker in Android renders a clock in React Native 64. It works as expected in React Native 63. I have only tested on Android.

Reproducible sample code

See this repo for a sample. Branch main uses RN 63 and works as expected. Branch rn-64 is exactly the same code, simply upgraded by running npx react-native upgrade

https://github.com/klandell/time-spinner-bug

Steps to reproduce

Open the app on an Android device. Click show time spinner. On react native 63, it shows as a spinner. On react native 64 it shows as a clock.

Environment info

Vanilla react native app, not Expo.

System:
    OS: macOS 11.1
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 564.87 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.0.1 - /var/folders/bq/rv3dbnrd4gnfymg9n66rgdc80000gn/T/yarn--1615903404422-0.9955909284122346/node
    Yarn: 1.22.10 - /var/folders/bq/rv3dbnrd4gnfymg9n66rgdc80000gn/T/yarn--1615903404422-0.9955909284122346/yarn
    npm: 7.0.3 - /usr/local/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      Android NDK: 21.0.6113669
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.6953283
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.9 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1 
    react-native: 0.64.0 => 0.64.0 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

datetimepicker version: 3.2 iOS / Android version: Samsung Galaxy S20e, Android 10.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
vonovakcommented, Mar 22, 2021

🎉 This issue has been resolved in version 3.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

1reaction
billnbellcommented, Mar 21, 2021

My recommendation is to do:

  private void fixSpinner(Context context, int hourOfDay, int minute, boolean is24HourView, RNTimePickerDisplay display) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && display == RNTimePickerDisplay.SPINNER) {

I’ll set up a PR

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-community/datetimepicker - npm
Defines the minimum date that can be selected. Note that on Android, this only works for date mode because TimePicker does not support...
Read more >
react-native-community/datetimepicker/CHANGELOG.md
3, ### Changelog is no longer maintained ... 55, - Fix android time picker returning today's date instead of the given date ......
Read more >
React Native DateTimePicker not Opening in IOS
but its not opening in IOS and not showing any error. i just created local component for datepicker so i can use it...
Read more >
React Native date & time picker component for iOS and Android
react-native link @react-native-community/datetimepicker. Then run pod install from the ios directory and rebuild your project. If this does not work, ...
Read more >
expo calendar react native
Note that on Android, this only works for date mode because TimePicker does not support this. Calendar. No additional setup is required when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found