diff --git a/.changeset/witty-cheetahs-walk.md b/.changeset/witty-cheetahs-walk.md new file mode 100644 index 000000000..253fa6df9 --- /dev/null +++ b/.changeset/witty-cheetahs-walk.md @@ -0,0 +1,5 @@ +--- +"@workleap/orbiter-ui": patch +--- + +Add a warning when user doesn't add a Heading or an aria-label attribute to a Popover diff --git a/packages/components/src/popover/src/Popover.tsx b/packages/components/src/popover/src/Popover.tsx index 26fd3f946..955ce1734 100644 --- a/packages/components/src/popover/src/Popover.tsx +++ b/packages/components/src/popover/src/Popover.tsx @@ -118,6 +118,10 @@ export function InnerPopover({ } }), [popoverId])); + if (isNil(heading) && isNil(ariaLabel)) { + console.error("A popover must either have a heading or an \"aria-label\" attribute."); + } + const headingId = heading?.props?.id; const footerMarkup = isString(footer?.props?.children)