Skip to content

Commit

Permalink
fix(NcPopover): add aria-modal to some popover-based dialog components
Browse files Browse the repository at this point in the history
Signed-off-by: Grigorii K. Shartsev <[email protected]>
  • Loading branch information
ShGKme committed Feb 29, 2024
1 parent 6f8f454 commit dd7ba31
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/NcActions/NcActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1804,6 +1804,7 @@ export default {
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

0 comments on commit dd7ba31

Please sign in to comment.