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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(NcPopover): add aria-modal to some popover-based dialog components #5309

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/NcActions/NcActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@
return this.$refs.menu.querySelector('li.active')
},
/**
* @return {NodeListOf<HTMLElement>}

Check warning on line 1356 in src/components/NcActions/NcActions.vue

View workflow job for this annotation

GitHub Actions / NPM lint

The type 'NodeListOf' is undefined
*/
getFocusableMenuItemElements() {
return this.$refs.menu.querySelectorAll(focusableSelector)
Expand Down Expand Up @@ -1804,6 +1804,7 @@
role: this.config.popupRole,
// Dialog must have a label
'aria-labelledby': this.actionsMenuSemanticType === 'dialog' ? triggerRandomId : undefined,
'aria-modal': this.actionsMenuSemanticType === 'dialog' ? 'true' : undefined,
},
}, [
actions,
Expand Down
1 change: 1 addition & 0 deletions src/components/NcColorPicker/NcColorPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export default {
</template>
<div role="dialog"
class="color-picker"
aria-modal="true"
:aria-label="t('Color picker')"
:class="{ 'color-picker--advanced-fields': advanced && advancedFields }">
<Transition name="slide" mode="out-in">
Expand Down
1 change: 1 addition & 0 deletions src/components/NcEmojiPicker/NcEmojiPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ This component allows the user to pick an emoji.
:show-skin-tones="false"
:title="previewFallbackName"
role="dialog"
aria-modal="true"
:aria-label="t('Emoji picker')"
v-bind="$attrs"
@select="select">
Expand Down
2 changes: 1 addition & 1 deletion src/components/NcPopover/NcPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ See: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/
</template>

<!-- Popover content should has the same role -->
<div role="dialog" aria-labelledby="popover-example-custom-role-1">
<div role="dialog" aria-labelledby="popover-example-custom-role-1" aria-modal="true">
<!-- This is not required but better to provide a label -->
<header id="popover-example-custom-role-1">
<strong>Confirm remove</strong>
Expand Down
Loading