DatePicker omits timezone for initially empty fields despite zoned placeholderValue
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
相关代码是 placeholderValue,位于 DatePicker.tsx 中:它从 props 中解构出来,但没有传给 AriaDatePicker,只传到了弹出层中的 TimeField。请先阅读组件如何构建 props,然后运行链接的 StackBlitz 复现,确认提交的值不含时区。完成标准是:带时区的 placeholderValue 的空 DatePicker 提交的值包含 UTC 时区,且现有的 DatePicker 测试全部通过。
由索引模型根据 Issue 内容生成。
描述
Provide a general summary of the issue here
An initially empty DatePicker with placeholderValue={now("UTC")} produces a date-time without a timezone after selecting a date.
🤔 Expected Behavior?
The selected value should inherit the UTC timezone from placeholderValue.
😯 Current Behavior
Selecting 2 November 2026 and submitting the form sends 2026-11-02T00:00:00. The value contains neither a timezone identifier nor an offset.
💁 Possible Solution
DatePicker.tsx destructures placeholderValue out of its props but does not forward it to <AriaDatePicker>. It only passes it to the popover’s TimeField.
🔦 Context
This affects a form containing date pickers. The backend expects zoned date-times for all submissions, so it rejects the submitted values.
🖥️ Steps to Reproduce
https://stackblitz.com/edit/e6rtt68y?file=src%2FExample.tsx
- Open the page
- Open the calendar popup and select a date
- Submit the form
- Observe the submitted value
Version
@react-spectrum/s2 1.8.2
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
macOS
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
- 主要语言
- TypeScript
- 星标
- 16k
- 派生
- 1.6k
- 平均合并
- 3 天 9 小时
- 30 天内合并 PR
- 45
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
adobe/react-spectrum 的其他 Issue
-
accessibility bug PreviewTrigger
难度 2/5 1-3 小时 新手友好度 76/100
adobe/react-spectrum#10917 · 1 条评论 ·
维护者通常 1 天内回复
-
S2 quiet Picker menu is always 192px wide: its width calc() has no unit可能已有人在做 @darshpatel1052 于 1 天前认领。 未关闭waiting on author
难度 2/5 1 小时以内 新手友好度 88/100
adobe/react-spectrum#10909 · 3 条评论 ·
维护者通常 1 天内回复
-
Separator adds a redundant role="separator" to its default <hr>可能已有人在做 @Janani-bn 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
adobe/react-spectrum#10894 · 2 条评论 ·
维护者通常 1 天内回复
-
ComboBox with selectionMode="multiple": Cmd/Ctrl+A does nothing while the popover is open可能已有人在做 @mangeshraut712 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
adobe/react-spectrum#10866 ·
维护者通常 1 天内回复
-
CheckboxGroup: `validationBehavior="aria"` is ignored by its checkboxes since 1.18可能已有人在做 @mangeshraut712 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
adobe/react-spectrum#10856 ·
维护者通常 1 天内回复
查看 adobe/react-spectrum 的全部 Issue
相似的 Issue
-
area: infrastructure bug priority: low
难度 2/5 1-3 小时 新手友好度 88/100
snapotter-hq/SnapOtter#4575 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
documentation server-memory v2
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/servers#5457 ·
维护者通常 1 天内回复
-
comp: ssr comp: zones type: feature version: current (v17+)
难度 2/5 1-3 小时 新手友好度 84/100
angular/angularfire#3836 ·
维护者通常 3 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复