ionic-team / ionic-team/ionic-framework

bug: FocusManagerPriority, unable to navigate to previously clicked link

未关闭
#29,875 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
triage
主要语言
TypeScript
星标
52.7k
派生
13.3k
平均合并
1 天 14 小时
30 天内合并 PR
50

描述

### Prerequisites

- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### Ionic Framework Version

v8.x

### Current Behavior

When implementing the `focusManagerPriority: ['content']` setting in our Ionic application we noticed that when we navigate to a link via the keyboard, click it and navigate back to the previous page that the clicked link is re-focused. Great experience to land back on the place you where you left off. However, if we focus the next element and then try to refocus the previous element it does not get the focus.

See example:
![issue](https://github.com/user-attachments/assets/5170cbab-7820-476c-8479-8148b8a2d7fe)
Note that the tabindex gets set to -1 after focussing the next element.

### Expected Behavior

The clicked link does not get tabindex -1 after focussing the next element.

### Steps to Reproduce

1. Focus button 2
2. Press enter
3. Land in tab 2
4. Click the (browser) back button
5. Land in tab 1
6. See that button 2 is still focussed
7. Press tab
8. Button 3 is focussed
9. Press shift + tab
10. Button 1 is now focussed (while we'd expect button 2 to be focussed)

### Code Reproduction URL

https://github.com/mikesegeren/ionic-focus-manager-priority-issue

### Ionic Info

Ionic CLI : 7.2.0
Ionic Framework : @ionic/angular 8.3.0
@angular-devkit/build-angular : 18.2.3
@angular-devkit/schematics : 18.2.3
@angular/cli : 18.2.3
@ionic/angular-toolkit : 11.0.1

Capacitor:

Capacitor CLI : 6.1.2
@capacitor/android : not installed
@capacitor/core : 6.1.2
@capacitor/ios : not installed

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v21.7.1
npm : 10.5.0
OS : macOS Unknown

### Additional Information

_No response_

贡献指南

打开贡献指南

调研方向

从链接的复现 URL 和 focusManagerPriority: ['content'] 设置开始,然后跟踪所列导航序列中的 tabindex 变化。复现返回导航和键盘操作步骤;完成的标准是,之前获得焦点的链接仍可通过 Shift+Tab 访问,而不是被分配 tabindex -1。

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

评估

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

把新 issue 发到你的邮箱

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