ionic-team / ionic-team/ionic-framework

bug: focus not trapped in modal with collapsible title

Đang mở
#30,669 0 bình luận 2 reaction 0 người được giao Xem trên GitHub
type: bug
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 using `collapse="condense"` on an ion-header inside a modal, the focus trapping functionality of the modal stops working, and tabbing results in focus being placed on elements outside the modal.

Once a modal with a collapsible title is opened, it seems like the focus trapping then stops working all together, even for other instances of modal that _do not_ use collapse title.

**The bug only happens in Chromium-based browsers.**

### Expected Behavior

Focus trapping functionality should be maintained even with collapsible titles.

### Steps to Reproduce

1. In a Chromium browser, go to https://stackblitz.com/edit/n35ryw68
2. Press 'Fixed Title Modal' button to open modal, and press Tab three times to verify that focus cycles between 'Cancel' and 'Confirm' inside the modal.
3. Close the modal and press 'Collapsible Title Modal' button, then press Tab three times
4. See that focus is now outside the modal, most likely on the first browser tab

### Code Reproduction URL

https://stackblitz.com/edit/n35ryw68

### Ionic Info

Stackblitz info:

```
Ionic:

Ionic CLI : 5.4.16

Utility:

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

System:

NodeJS : v20.19.1
npm : 10.8.2
OS : Linux 5.0
```

### Additional Information

_No response_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Run the linked StackBlitz reproduction in a Chromium-based browser and compare the fixed-title and collapsible-title modal flows. Trace the ion-modal focus-trapping behavior alongside the collapse="condense" header behavior; done means Tab remains confined to the open modal in both cases, including after opening a collapsible-title modal.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
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

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.