Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f

- Fixed accessibility issue with ChoiceList errors not being correctly connected to the inputs ([#1824](https://github.com/Shopify/polaris-react/pull/1824));
- Fixed `Tab` `aria-controls` pointing to a non-existent `Panel` `id` ([#1869](https://github.com/Shopify/polaris-react/pull/1869))
- Fixed `Toast` accessibility issue by moving `aria-live` prop to `ToastManager` ([#1873](https://github.com/Shopify/polaris-react/pull/1873))

### Documentation

Expand Down
4 changes: 2 additions & 2 deletions src/components/Frame/components/ToastManager/ToastManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class ToastManager extends React.PureComponent<Props, never> {
timeout={{enter: 0, exit: 400}}
classNames={toastClasses}
>
<div ref={this.toastNodes[index]} aria-live="polite">
<div ref={this.toastNodes[index]}>
<Toast {...toast} />
</div>
</CSSTransition>
Expand All @@ -41,7 +41,7 @@ export default class ToastManager extends React.PureComponent<Props, never> {
return (
<Portal idPrefix="toast-manager">
<EventListener event="resize" handler={this.updateToasts} />
<div className={styles.ToastManager}>
<div className={styles.ToastManager} aria-live="polite">
<TransitionGroup component={null}>{toastsMarkup}</TransitionGroup>
</div>
</Portal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ describe('<ToastManager />', () => {
});
}).not.toThrow();
});

it('has and aria-live attribute of polite', () => {
const toastManager = mountWithAppProvider(
<ToastManager
toastMessages={[{id: '1', content: 'Hello', onDismiss: noop}]}
/>,
);

expect(
toastManager
.find('div')
.at(0)
.prop('aria-live'),
).toBe('polite');
});
});

describe('<Toast />', () => {
Expand Down