Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Modal, Frame(Nav), Sheet] Trapped virtual cursor inside dialogs #3931

Merged
merged 4 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f

### Bug fixes

- Fixed virtual cursor leaving dialog in `Modal`, `Navigation` and `Sheet` ([#3931](https://github.com/Shopify/polaris-react/pull/3931))

### Documentation

### Development workflow
Expand Down
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
},
"Frame": {
"skipToContent": "Skip to content",
"navigationLabel": "Navigation",
"Navigation": {
"closeMobileNavigationLabel": "Close navigation"
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/Frame/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ class FrameInner extends PureComponent<CombinedProps, State> {
classNames={navTransitionClasses}
>
<div
aria-modal
role="dialog"
AndrewMusgrave marked this conversation as resolved.
Show resolved Hide resolved
aria-label={i18n.translate('Polaris.Frame.navigationLabel')}
ref={this.navigationNode}
className={navClassName}
onKeyDown={this.handleNavKeydown}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Frame/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ function FrameExample() {
},
Frame: {
skipToContent: 'Skip to content',
navigationLabel: 'Navigation',
Navigation: {
closeMobileNavigationLabel: 'Close navigation',
},
Expand Down Expand Up @@ -680,6 +681,7 @@ function FrameExample() {
},
Frame: {
skipToContent: 'Skip to content',
navigationLabel: 'Navigation',
Navigation: {
closeMobileNavigationLabel: 'Close navigation',
},
Expand Down
1 change: 1 addition & 0 deletions src/components/Modal/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export function Dialog({
<TrapFocus>
<div
role="dialog"
aria-modal
aria-labelledby={labelledBy}
tabIndex={-1}
className={styles.Dialog}
Expand Down
1 change: 1 addition & 0 deletions src/components/Sheet/Sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export function Sheet({
<TrapFocus trapping={open}>
<div
role="dialog"
aria-modal
tabIndex={-1}
className={styles.Sheet}
aria-label={accessibilityLabel}
Expand Down