React Native Windows: value except only Date as object, onchange not triggered if unselect date
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, react-native, typescript
調査の方向性
Start in the Windows picker implementation, datetimepicker.windows.js, and trace how sharedPropsValidation handles value and how onChange is called when the selected date is cleared. The report names utils.js as the validation location; check its tests and the Windows picker tests first. Done means null or undefined can be used as the value and clearing a date fires onChange; the issue has gone 873 days without a comment.
索引モデルが issue の本文から書いたものです。
説明
Bug report
Summary
datetimepicker.windows.js
- I want to set
undefinedornullas date value but it is prevented by validation. If i comment that line eveything is working fine. - If unselect the date in the datepicker by clicking on the current selected date, the onChange Event is never fired. So i never know how the state of the picker is.
Reproducible sample code
<DateTimePicker
style={styles.datePicker}
value={null} // NOT POSSIBLE to set NULL
display="calendar"
firstDayOfWeek={1}
onChange={(event: DateTimePickerEvent, date?: Date) => {
// NOT FIRED if unselect the date
}}
onError={(arg: Error) => console.log('GKU Date Error', arg)}/>
Steps to reproduce
--
Describe what you expected to happen:
- Null as initial value should be allows
- Validation for value in utils.js should be removed because it is already checked. And if i remove the init validation (sharedPropsValidation) everything works fine:
export default function RNDateTimePickerQWE(
props: WindowsNativeProps,
): React.Node {
sharedPropsValidation({value: props?.value}); // **REMOVING THIS LINE FIXES THE ISSUE**
const localProps = {
dayOfWeekFormat: props.dayOfWeekFormat,
dateFormat: props.dateFormat,
firstDayOfWeek: props.firstDayOfWeek,
maxDate: props.maximumDate ? props.maximumDate.getTime() : undefined, // time in milliseconds
minDate: props.minimumDate ? props.minimumDate.getTime() : undefined, // time in milliseconds
onChange: props.onChange,
placeholderText: props.placeholderText,
selectedDate: props.value ? props.value.getTime() : undefined, // time in milliseconds
style: [styles.rnDatePicker, props.style],
};
...
Environment info
npx react-native info output:
System:
OS: Windows 10 10.0.22621
CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
Memory: 13.63 GB / 31.73 GB
Binaries:
Node:
version: 16.19.1
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 3.6.0
path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm:
version: 8.19.3
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions:
- 10.0.18362.0
- 10.0.19041.0
- 10.0.22000.0
- 10.0.22621.0
IDEs:
Android Studio: AI-222.4459.24.2221.10121639
Visual Studio:
- 17.5.33502.453 (Visual Studio Community 2022)
- 16.11.33423.256 (Visual Studio Community 2019)
Languages:
Java: Not Found
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.4
wanted: 0.72.4
react-native-windows:
installed: 0.72.7
wanted: 0.72.7
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
datetimepicker version: 4.5.0
React Native Windows
- 主要言語
- JavaScript
- スター
- 2.9k
- フォーク
- 459
- 平均マージ
- 4日 16時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
react-native-datetimepicker/datetimepicker のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
react-native-datetimepicker/datetimepicker#1070 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
react-native-datetimepicker/datetimepicker#1047 · コメント 6 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
react-native-datetimepicker/datetimepicker#1046 · コメント 1 件 ·
react-native-datetimepicker/datetimepicker の issue をすべて見る
似ている issue
-
Administration: required plugin configuration field stays invalid after restoring its saved valueオープンneeds-triage Platform(Default)
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
nearform/ag-grid-url-sync#314 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
chore
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
idean3885/claude-ops-agent#910 ·
メンテナーはふだん 1 日以内に返信
-
S: triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
oskarrough/agent-ide#29 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信