Skip to content

Commit

Permalink
fix(drawer): remove focus guards due to tabIndex a11y issue (uber#4620)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamernest authored Nov 15, 2021
1 parent 53c688c commit 1fe4178
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/drawer/__tests__/drawer.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ describe('drawer', () => {
expect(closeButtonIsFocused).toBe(true);

// drawer should be accessible
const accessibilityReport = await analyzeAccessibility(page, {
// disable tabindex rule because react-focus-lock uses tabindex to trap focus
rules: [{id: 'tabindex', enabled: false}],
});
const accessibilityReport = await analyzeAccessibility(page);
expect(accessibilityReport).toHaveNoAccessibilityIssues();

// close again
Expand Down
2 changes: 1 addition & 1 deletion src/drawer/drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class Drawer extends React.Component<DrawerPropsT, DrawerStateT> {
<LocaleContext.Consumer>
{locale => {
return (
<FocusLock returnFocus autoFocus={autoFocus}>
<FocusLock returnFocus autoFocus={autoFocus} noFocusGuards={true}>
<Root
data-baseweb="drawer"
ref={this.getRef('Root')}
Expand Down

0 comments on commit 1fe4178

Please sign in to comment.