ionic-team / ionic-team/ionic-framework
bug: FocusManagerPriority, unable to navigate to previously clicked link
- Ngôn ngữ chính
- TypeScript
- Star
- 52.7k
- Fork
- 13.3k
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 51
Mô tả
### 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:

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_
Hướng dẫn đóng góp
Hướng nghiên cứu
Start with the linked reproduction URL and the focusManagerPriority: ['content'] setting, then trace the tabindex changes during the listed navigation sequence. Reproduce the back-navigation and keyboard steps; done means the previously focused link remains eligible for Shift+Tab instead of being assigned tabindex -1.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- angular, typescript
- Lĩnh vực
- accessibility, frontend
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100