ionic-team / ionic-team/ionic-framework

feat: banner component for medium priority information

未关闭
#27,668 6 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
package: core type: feature request
主要语言
TypeScript
星标
52.7k
派生
13.3k
平均合并
1 天 15 小时
30 天内合并 PR
51

描述

### Prerequisites

- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/.github/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 include this feature request, without success.

### Describe the Feature Request

Being able to add a `role="log"` (when notifications need to be read in order, _e.g., stacking toast notifications on each other_ or `role="alert"` to toast notifications that are being logged to make them more accessible.

### Describe the Use Case

This will ensure that when a toast is displayed on screen, its contents will be communicated correctly to assistive technologies, such as screen readers when using the correct `role` with the toast notification.

### Describe Preferred Solution

I know `role="status"` is et on the inner `.toast-content` element but since there is an option should the developer want the toasts to be logged, I think it would work better as an option.

* - Same with `aria-live="polite"` (another feature request later) if someone needed to use `aria-live="assertive"` (which clears the speech queue of previous updates. _"off"_ should be the default anyway).

### Describe Alternatives

_No response_

### Related Code

```html

```

### Additional Information

[A toast to an accessible toast...](https://www.scottohara.me/blog/2019/07/08/a-toast-to-a11y-toasts.html)
[Defining ‘Toast’ Messages](https://adrianroselli.com/2020/01/defining-toast-messages.html)
[Designing Toast Messages for Accessibility](https://sheribyrnehaber.medium.com/designing-toast-messages-for-accessibility-fb610ac364be)

It is also acceptable to use `role="alert"` in a toast notification to stop the current reading and notify the user of an alert. Focus should not move there. It had a drawback in that it could make a user feel stranded because of the interruption and consequential stoppage of reading by the screen reader, however.

If the alert has interactive controls, then it should be a modal and not a toast notification. Toast notifications should never have interactive controls in them.

贡献指南

打开贡献指南

调研方向

The issue does not name files, tests, or an entry point. Start by locating the toast component and reading how its current role="status" behavior is implemented; done should include a documented, tested way to select the requested notification role without moving focus.

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

评估

技术栈
typescript
领域
accessibility, frontend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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