Skip to content

Commit

Permalink
tab order accessibility update
Browse files Browse the repository at this point in the history
RachelDau committed Mar 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent e4369ab commit b96d0c1
Showing 5 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -30,7 +30,9 @@ exports[`Notification component hides the notification on exit button click 1`]
<div
className="notification-header"
>
<h1>
<h1
tabindex="0"
>
Test Title
</h1>
<button
@@ -40,7 +42,9 @@ exports[`Notification component hides the notification on exit button click 1`]
x
</button>
</div>
<p>
<p
tabindex="0"
>
Test Notification
</p>
</div>
Original file line number Diff line number Diff line change
@@ -38,12 +38,12 @@ const Notification = ({ onDataFromNotification }) => {
return (
<div className={`notification-banner`} key={key}>
<div className="notification-header">
<h1>{title}</h1>
<h1 tabindex="0">{title}</h1>
<button onClick={() => onClickExitNotification(key)} className="notification-exit-button">
x
</button>
</div>
<p>{text}</p>
<p tabindex="0">{text}</p>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@ const RepositoryNav = props => {
const onBlurHandler = () => {
timeOutId = setTimeout(() => {
setMenuOpen(false)
setNotificationsOpen(false)
})
}
const onFocusHandler = () => {
@@ -90,10 +89,9 @@ const RepositoryNav = props => {
{props.displayName}

{numberNotifications > 0 && (
<div className="notification-indicator" onClick={onToggleNotifications}>
{' '}
{numberNotifications} Notifications{' '}
</div>
<button className="notification-indicator" onClick={onToggleNotifications}>
{numberNotifications} Notifications
</button>
)}
</div>
<Avatar
Original file line number Diff line number Diff line change
@@ -123,6 +123,7 @@
.notification-indicator {
color: $color-notification;
cursor: pointer;
height: 0;
}

.repository--nav--current-user--name {
Original file line number Diff line number Diff line change
@@ -283,7 +283,7 @@ describe('RepositoryNav', () => {

expect(
component.root.findByProps({ className: 'repository--nav--current-user--name' }).children[1]
.props.children[1]
.props.children[0]
).toBe(5)
})
test('renders null when there are no notifications but document.cookie is not null', () => {

0 comments on commit b96d0c1

Please sign in to comment.