datetimepicker icon indicating copy to clipboard operation
datetimepicker copied to clipboard

[Android] Time Spinner doesn't work as intended with Keyboard

Open philipp65 opened this issue 2 years ago • 0 comments

Bug report

Summary

On mode time with display spinner on Android it is possible to enter the time using the keyboard. If the user clicks on either hour or minute, the keyboard opens. After entering the number

  • onChange is not triggered automatically
  • there are few places to click on the modal itself to get the number accepted, most of the areas do nothing or close the modal
  • even a click on the OK button with keyboard expanded doesn't trigger onChange
  • only the confirmation on the last field on the keyboard itself triggers onChange

Reproducible sample code

    <DateTimePicker
      value={value}
      mode={'time'}
      is24Hour={true}
      display="spinner"
      onChange={onChange}
    />

Steps to reproduce

  1. implement DateTimePicker with mode time and display spinner
  2. edit the 2 fields using the keyboard
  3. listen for onChange events

Describe what you expected to happen:

  1. the OK button should send the currently entered date in onChange
  2. there may be a possibility to disable keyboard entries (myTimePicker.setDescendantFocusability(TimePicker.FOCUS_BLOCK_DESCENDANTS);)

Environment info

npx react-native info output:

System:
    OS: Windows 10 10.0.19044
    CPU: (16) x64 AMD Ryzen 7 4800H with Radeon Graphics
    Memory: 12.35 GB / 31.87 GB
  Binaries:
    Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.15 - C:\Program Files (x86)\Yarn\bin\yarn.CMD     
    npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK:
      API Levels: 29, 30, 31
      Build Tools: 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 31.0.0, 31.0.0, 32.0.0, 32.0.0, 32.1.0, 33.0.0
      System Images: android-19 | Google APIs ARM EABI v7a, android-19 | Google APIs Intel x86 Atom, android-25 | Google APIs ARM 64 v8a, android-28 | Wear OS Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64, android-30 | Google APIs 
Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-31 | Google APIs Intel x86 Atom_64
      Android NDK: Not Found
    Windows SDK: Not Found
  IDEs:
    Android Studio: Version     2021.1.0.0 AI-211.7628.21.2111.8309675
    Visual Studio: Not Found
  Languages:
    Java: 11.0.14.1 - C:\Program Files\OpenJDK\openjdk-11.0.14.1_1\bin\javac.EXE
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.67.3 => 0.67.3
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

datetimepicker version: ^6.1.2

iOS / Android version: 11

philipp65 avatar Apr 28 '22 10:04 philipp65