iOS disable keyboard input for mode="time"
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 38/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- javascript, objective-c, react-native
研究方向
The proposed change targets ios/RNDateTimePicker.m; read its event registration and date picker responder handling first. The report says to resign the picker’s first responder when editing begins, preventing keyboard input in mode="time"; verify the behavior with the reported modal date picker and ensure normal time selection still works.
由索引模型根據 Issue 內容生成。
描述
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch @react-native-community/[email protected] for the project I'm working on.
This disables the keyboard input on the mode="time" which many of our users thought is a bug :-/ and this doesn't play well with the https://github.com/mmazzarolo/react-native-modal-datetime-picker
Here is the diff that solved my problem:
diff --git a/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePicker.m b/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePicker.m
index 9c73c8e..efaa23f 100644
--- a/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePicker.m
+++ b/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePicker.m
@@ -26,9 +26,9 @@
#ifndef RCT_NEW_ARCH_ENABLED
// somehow, with Fabric, the callbacks are executed here as well as in RNDateTimePickerComponentView
// so do not register it with Fabric, to avoid potential problems
- [self addTarget:self action:@selector(didChange)
- forControlEvents:UIControlEventValueChanged];
+ [self addTarget:self action:@selector(didChange) forControlEvents:UIControlEventValueChanged];
[self addTarget:self action:@selector(onDismiss:) forControlEvents:UIControlEventEditingDidEnd];
+ [self addTarget:self action:@selector(handleDatePickerTap) forControlEvents:UIControlEventEditingDidBegin];
#endif
_reactMinuteInterval = 1;
@@ -52,6 +52,11 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
}
}
+- (void)handleDatePickerTap
+{
+ [self resignFirstResponder];
+}
+
- (void)setDatePickerMode:(UIDatePickerMode)datePickerMode
{
[super setDatePickerMode:datePickerMode];
This issue body was partially generated by patch-package.
- 主要語言
- JavaScript
- 星號
- 2.9k
- 分支
- 459
- 平均合併
- 4 天 16 小時
- 30 天內合併 PR
- 5
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 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
-
難度 2/5 1-3 小時 新手友好度 75/100
swc-project/swc-ai-issues#414 ·
-
[workshop-sim] Repair: Make Copilot access and billing path decision self-contained in Steps 07/07d未關閉feedback simulation workshop
難度 2/5 1-3 小時 新手友好度 72/100
githubnext/gh-aw-workshop#5597 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
swagger-api/swagger-client#4318 ·
維護者通常 1 天內回覆
-
check:passed feeds:add
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
Disabled radio toggle button groups lose checked state可能已有人在做 @vladosskins178 今天認領。 未關閉bug confirmed css has-pr v6
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆