Skip to content

Commit

Permalink
tab order accessibility update
Browse files Browse the repository at this point in the history
  • Loading branch information
RachelDau committed Mar 13, 2024
1 parent e4369ab commit b96d0c1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const RepositoryNav = props => {
const onBlurHandler = () => {
timeOutId = setTimeout(() => {
setMenuOpen(false)
setNotificationsOpen(false)
})
}
const onFocusHandler = () => {
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
.notification-indicator {
color: $color-notification;
cursor: pointer;
height: 0;
}

.repository--nav--current-user--name {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit b96d0c1

Please sign in to comment.