Skip to content

Commit

Permalink
#5428 for Message
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitfindikli committed Nov 28, 2023
1 parent 6e9963f commit ddff3db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 32 deletions.
32 changes: 1 addition & 31 deletions components/doc/message/accessibilitydoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,15 @@ import Link from 'next/link';

export function AccessibilityDoc() {
return (
<DevelopmentSection>
<DocSectionText id="accessibility" label="Accessibility">
<h3>Screen Reader</h3>
<p>
Message components use <i>alert</i> role that implicitly defines <i>aria-live</i> as "assertive" and <i>aria-atomic</i> as "true". Since any attribute is passed to the root element, attributes like <i>aria-labelledby</i> and{' '}
<i>aria-label</i> can optionally be used as well.
</p>

<p>
Close element is a <i>button</i> with an <i>aria-label</i> that refers to the <i>aria.close</i> property of the <Link href="/locale">locale</Link> API by default, you may use
<i>closeButtonProps</i> to customize the element and override the default <i>aria-label</i>.
</p>

<h3>Close Button Keyboard Support</h3>
<div className="doc-tablewrapper">
<table className="doc-table">
<thead>
<tr>
<th>Key</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<i>enter</i>
</td>
<td>Closes the message.</td>
</tr>
<tr>
<td>
<i>space</i>
</td>
<td>Closes the message.</td>
</tr>
</tbody>
</table>
</div>
<p>Component does not include any interactive elements.</p>
</DocSectionText>
</DevelopmentSection>
);
}
3 changes: 2 additions & 1 deletion components/lib/message/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ export const Message = React.memo(
className: classNames(props.className, cx('root')),
style: props.style,
role: 'alert',
'aria-live': 'polite'
'aria-live': 'polite',
'aria-atomic': 'true'
},
MessageBase.getOtherProps(props),
ptm('root')
Expand Down

0 comments on commit ddff3db

Please sign in to comment.