angular / angular/components

bug(datepicker): Focus Not Properly Managed After Selecting Date in Angular Datepicker (VoiceOver, iOS)

未关闭
#31,473 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
P2
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

The Angular date picker doesn't properly focus on the selected date when using VoiceOver on iOS. When I try to select a date, the calendar opens as expected, and I double-tap to choose a date using VoiceOver. However, after the date is selected, the double-tap also triggers a selection on whatever element is behind the calendar.

### Reproduction

Steps to reproduce:
1. Enable VoiceOver on iOS.
2. Navigate to [Angular Material Datepicker](https://material.angular.dev/components/datepicker/overview).
3. Open the datepicker; the calendar overlay appears.
4. Using VoiceOver, double-tap to select a date.
5. After the double-tap, focus unexpectedly shifts to an element behind the calendar instead of remaining within the datepicker.

![Image](https://github.com/user-attachments/assets/11398383-94a4-460f-9dee-f95fc38168d8)
![Image](https://github.com/user-attachments/assets/30798904-31a7-4d81-9442-4743afa04e8b)

### Expected Behavior

After selecting a date using VoiceOver, the focus should return to the datepicker input, not shift to elements behind the calendar.

### Actual Behavior

After selecting a date with VoiceOver, the focus shifts to an element behind the calendar instead of returning to the datepicker input.

### Environment

- Angular: 18, 20
- CDK/Material: 18, 20
- Browser(s): Safari, Chrome, Brave
- Operating System (e.g. Windows, macOS, Ubuntu): iOS

贡献指南

打开贡献指南

调研方向

首先,按照列出的步骤,在启用 VoiceOver 的 iOS 上复现 Angular Material Datepicker 概览中的问题。检查日期选择后 datepicker 的焦点处理,并确认焦点会返回 datepicker 输入框,而不是返回日历后面的元素;如果现有的 datepicker 测试能够暴露该问题,请通过回归测试覆盖此行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
accessibility, frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。