ionic-team / ionic-team/ionic-framework

feat: banner component for medium priority information

Open
#27,668 6 comments 1 reaction 0 assignees View on GitHub
package: core type: feature request
Dominant language
TypeScript
Stars
52.7k
Forks
13.3k
Avg merge
1d 15h
Merged PRs (30d)
51

Description

### 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.

Contributor guide

Open the contributing guide

Research direction

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.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
accessibility, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.