-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-focus the notification banner, add tests #1994
Merged
hannalaakso
merged 2 commits into
feature/notification-banner
from
add-notifications-auto-focus
Oct 29, 2020
Merged
Auto-focus the notification banner, add tests #1994
hannalaakso
merged 2 commits into
feature/notification-banner
from
add-notifications-auto-focus
Oct 29, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-review-pr-1994
October 22, 2020 17:24
Inactive
hannalaakso
commented
Oct 22, 2020
hannalaakso
force-pushed
the
add-notifications-auto-focus
branch
from
October 22, 2020 17:47
2abb78c
to
b84d8c2
Compare
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-review-pr-1994
October 22, 2020 17:47
Inactive
hannalaakso
force-pushed
the
add-notifications-auto-focus
branch
from
October 26, 2020 09:54
b84d8c2
to
ac4831d
Compare
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-review-pr-1994
October 26, 2020 09:54
Inactive
src/govuk/components/notification-banner/notification-banner.js
Outdated
Show resolved
Hide resolved
src/govuk/components/notification-banner/notification-banner.js
Outdated
Show resolved
Hide resolved
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-review-pr-1994
October 26, 2020 15:56
Inactive
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-review-pr-1994
October 27, 2020 16:41
Inactive
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-review-pr-1994
October 27, 2020 17:03
Inactive
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-review-pr-1994
October 28, 2020 18:33
Inactive
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-review-pr-1994
October 28, 2020 18:37
Inactive
36degrees
reviewed
Oct 29, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking really good – just a couple of minor comments 👍🏻
src/govuk/components/notification-banner/notification-banner.test.js
Outdated
Show resolved
Hide resolved
src/govuk/components/notification-banner/notification-banner.js
Outdated
Show resolved
Hide resolved
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-review-pr-1994
October 29, 2020 16:39
Inactive
36degrees
approved these changes
Oct 29, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏🏻
If a notification banner has `role="alert”`, add tabindex=“-1” to it so it can be focused and move keyboard focus to it with JavaScript for increased visibility to assistive technologies. Don’t focus the banner if it has the data-disable-auto-focus attribute.
Test if the element has the correct tabindex and can be focused. Test that element is not focused if it has the data-disable-auto-focus attribute or it doesn’t have role=alert.
hannalaakso
force-pushed
the
add-notifications-auto-focus
branch
from
October 29, 2020 16:55
ac6187d
to
d9cc60a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR:
role="alert"
and addstabindex="1"
so it can be fosused.role=alert
, it should receivetabindex="1"
so it can be focused with JavaScript and the keyboard focus should move to it on page loaddata-disable-auto-focus
attribute, or it doesn't haverole="alert"
it should not have a tabindex or be focusedTested in:
✅ Chrome 86 (Mac)
✅ Firefox 81 (Mac)
✅ Safari 14 (Mac)
✅ Galaxy S20 (Android 10)
✅ Galaxy Note 10 (Android 9)
✅ iPhone XS 12
✅ IE11
✅ IE10
✅ IE9
✅ IE8
Addresses part of #1935