DateTimePicker refocuses on TextInput and reopens keyboard in ScrollView with keyboardShouldPersistTaps="handled"

オープン
#794 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
android, ios, javascript, react-native
領域
mobile

調査の方向性

Start by tracing how the React Native date picker handles closing and focus on iOS and Android, then look for tests covering interaction with TextInput inside a ScrollView. Reproduce the supplied sample with keyboardShouldPersistTaps="handled"; done means closing the picker leaves the input unfocused and the keyboard closed. The issue names no source files or tests, so locate the relevant entry points first.

索引モデルが issue の本文から書いたものです。

説明

Bug report

Summary

If used together with <TextInput /> component placed inside a ScrollView with keyboardShouldPersistTaps set to "handled" It correctly captures the press and closes the keyboard but after closing the picker it refocuses the previous Input and opens the keyboard. Using Keyboard.dismiss while it is open will lead to no effect or a flicker if we introduce some timeout.

Reproducible sample code

import {SafeAreaView, ScrollView, TextInput} from 'react-native';
import RNDateTimePicker from '@react-native-community/datetimepicker';

const App = () => {
return (


<TextInput
placeholder="text2"
style={{padding: 16, marginTop: 16, backgroundColor: '#dddddd'}}
/>
<RNDateTimePicker value={new Date()} />


);
};

export default App;

Steps to reproduce

  1. Focus the
  2. Click on the DatePicker
  3. Click outside the DatePicker to close it
  4. TextInput is focused again and Keyboard opens

Describe what you expected to happen:

  1. Focus the
  2. Click on the DatePicker
  3. Click outside the DatePicker to close it
  4. No autofocusing or keyboard opening

Environment info

npx react-native info output:

System:
    OS: macOS 12.6.5
    CPU: (8) arm64 Apple M1 Pro
    Memory: 153.47 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
    Watchman: 2022.10.31.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK: Not Found
  IDEs:
    Android Studio: 2022.2 AI-222.4459.24.2221.9971841
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.15 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0 
    react-native: 0.69.7 => 0.69.7 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

datetimepicker version: 7.4.1

iOS / Android version: 16.2

主要言語
JavaScript
スター
2.9k
フォーク
459
平均マージ
4日 16時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

react-native-datetimepicker/datetimepicker のほかの issue

react-native-datetimepicker/datetimepicker の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。