Skip to content

Commit

Permalink
Merge pull request #5306 from nextcloud-libraries/fix/nc-popover--req…
Browse files Browse the repository at this point in the history
…uired-popup-role

fix(NcPopover): make popupRole non-required
  • Loading branch information
susnux committed Feb 26, 2024
2 parents 2110ea1 + 760f518 commit e289255
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/components/NcPopover/NcPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ export default {
/**
* Popup role
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup#values
* By default undefined because popup can't be always as menu
*/
popupRole: {
type: String,
Expand Down Expand Up @@ -283,7 +282,7 @@ export default {
// TODO: Vue 3: should be
// this.$refs.popover.$refs.popper.$refs.reference
const triggerContainer = this.$refs.popover.$refs.reference
const requiredTriggerButton = triggerContainer.querySelector('[aria-expanded][aria-haspopup]')
const requiredTriggerButton = triggerContainer.querySelector('[aria-expanded]')
if (!requiredTriggerButton) {
Vue.util.warn('It looks like you are using a custom button as a <NcPopover> or other popover #trigger. If you are not using <NcButton> as a trigger, you need to bind attrs from the #trigger slot props to your custom button. See <NcPopover> docs for an example.')
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/NcPopover/NcPopoverTriggerProvider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default defineComponent({
},
popupRole: {
type: String,
required: true,
default: undefined,
},
},
Expand Down

0 comments on commit e289255

Please sign in to comment.