diff --git a/lib/components/ActionsMenu/index.js b/lib/components/ActionsMenu/index.js index 20e2fe32..aed39287 100644 --- a/lib/components/ActionsMenu/index.js +++ b/lib/components/ActionsMenu/index.js @@ -188,12 +188,11 @@ export const ActionsMenuItem = styled((props) => { const { as, ...others } = props; const Component = as ? as : others.href ? "a" : "button"; - const disabled = !actionMenu?.context?.open ?? false; + const disabled = props.disabled; let newProps = { ...others, - ...(actionMenu?.getItemProps?.() || {}), - disabled + ...(actionMenu?.getItemProps?.() || {}) }; const { onClick: originalOnClick } = newProps; @@ -210,12 +209,20 @@ export const ActionsMenuItem = styled((props) => { newProps = { ...others, type: "button", - ["data-action-menu-id"]: id, - disabled + ["data-action-menu-id"]: id }; } - return ; + return ( + + ); }).attrs({ role: "menuitem" })` white-space: nowrap; display: block; @@ -269,7 +276,7 @@ export const ActionsMenuBody = ({ onTriggerFocus, closeMenu, closeOnClick = false, - "data-testid": dataTestId, + "data-testid": dataTestId = "ActionsMenu", ...props }) => { const id = useId(); @@ -341,6 +348,7 @@ export const ActionsMenuBody = ({ {...actionMenu.getFloatingProps(props)} className={`actionMenu-content ${visible ? "visible" : ""}`} aria-hidden={visible ? "false" : "true"} + data-testid={`${dataTestId}__menu`} > {children} diff --git a/package-lock.json b/package-lock.json index 07e41110..871e34c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "orcs-design-system", - "version": "3.2.22", + "version": "3.2.23", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "orcs-design-system", - "version": "3.2.22", + "version": "3.2.23", "dependencies": { "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", diff --git a/package.json b/package.json index 8b84c242..aa0ee12b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orcs-design-system", - "version": "3.2.22", + "version": "3.2.23", "engines": { "node": "20.12.2" },