-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix iseec 2378 UI shell accessibility #49
Conversation
…g-react into fix-ISEEC-2378-ui-shell-accessibility
@MthdeSouza Added a few more a11y things for the header (and fixed some tests, cleaned up some code) |
@@ -49,14 +49,14 @@ | |||
}, | |||
"dependencies": { | |||
"@carbon/elements": "^10.21.0", | |||
"@carbon/themes": "^10.21.0", |
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.
Removed redundant dependency
"@stomp/stompjs": "^5.4.2", | ||
"@tippyjs/react": "^4.0.2", | ||
"carbon-icons": "^7.0.7", | ||
"classnames": "^2.2.5", | ||
"date-fns": "^1.30.1", | ||
"dompurify": "^2.0.6", | ||
"downshift": "^5.2.1", | ||
"invariant": "^2.2.3", | ||
"focus-trap-react": "^8.9.1", |
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.
Remove dependencies that aren't used and migrated to use of a better focus trap library for focus management from the UIShell
@@ -50,7 +50,7 @@ test('select and remove items', async () => { | |||
expect(queryByLabelText(/Clear filter cat/i)).toBeInTheDocument(); | |||
}); | |||
|
|||
const clearButton = getByRole('button', { name: 'Clear Selection' }); | |||
const clearButton = getByRole('button', { name: 'Clear selected item' }); |
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.
Fix test
@@ -4,8 +4,8 @@ import Error403 from './Error403'; | |||
|
|||
test('render Error403 with defaults', async () => { | |||
const { getByText } = render(<Error403 />); | |||
expect(getByText('403 - Access Forbidden')).toBeInTheDocument(); | |||
expect(getByText('You’ve found yourself in deep water.')).toBeInTheDocument(); | |||
expect(getByText('403 Access Forbidden')).toBeInTheDocument(); |
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.
Fix test
@@ -5,15 +5,15 @@ import Error404 from './Error404'; | |||
|
|||
test('render Error404 with defaults', async () => { | |||
const { getByText } = render(<Error404 />); | |||
expect(getByText('404 - Page Not Found')).toBeInTheDocument(); | |||
expect(getByText('Crikey. Something seems to have swam off with this page.')).toBeInTheDocument(); | |||
expect(getByText('404 Page Not Found')).toBeInTheDocument(); |
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.
Fix test
@@ -8,15 +8,14 @@ const { prefix } = settings; | |||
const HeaderMenuBmrg = React.forwardRef((props, ref) => { | |||
const { isOpen, ...other } = props; | |||
return ( | |||
<div | |||
<button |
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.
Made this a proper button and fixed some styling for it to match better w/ the rest of the header
))} | ||
</ul> | ||
</div> | ||
<FocusTrap active focusTrapOptions={{ allowOutsideClick: true }}> |
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.
Focus trap here to keep the tabbing inside the menu while it is open. ESC closes it.
@@ -12,9 +11,8 @@ import { | |||
NotificationNew24, | |||
} from '@carbon/icons-react'; | |||
import { settings } from 'carbon-components'; | |||
import FocusTrap from 'focus-trap-react'; |
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.
I made a few changes here to manage:
- Focus traps within the different menus and the sidenav
- Handling the "ESC" key to exit out of the sidenav and menus and returning focus to the button associated w/ the menu.
- Tab to leave the side panel (not sure if this is the best approach but its not used afaik at the moment)
- Removed dead code.
Context
Jira Issue:
ISEEC-2378
Build Number:
1.4.1-beta.5
Checklist:
PR Review Guidance
Additional Info