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): make popupRole non-required #5306

Merged
merged 1 commit into from
Feb 26, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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