From 286011d5230af3825c4843af554c69ba799393f0 Mon Sep 17 00:00:00 2001 From: Adarsh Pastakia Date: Tue, 15 Oct 2024 12:43:31 +0400 Subject: [PATCH] test: fix test issues --- packages/core/src/components/menu/Menu.tsx | 2 +- packages/core/src/components/menu/types.ts | 4 ++-- packages/core/src/components/tabpanel/Tab.tsx | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/core/src/components/menu/Menu.tsx b/packages/core/src/components/menu/Menu.tsx index 5c2cb09..20ff19c 100644 --- a/packages/core/src/components/menu/Menu.tsx +++ b/packages/core/src/components/menu/Menu.tsx @@ -162,7 +162,7 @@ const MenuComponent = ({ (e: React.MouseEvent) => { const el = e.target as HTMLElement; if (el.dataset.id) { - onClick?.(el.dataset.id); + onClick?.(el.dataset.id as AnyObject); } }, [onClick], diff --git a/packages/core/src/components/menu/types.ts b/packages/core/src/components/menu/types.ts index 047c1e0..5ae58aa 100644 --- a/packages/core/src/components/menu/types.ts +++ b/packages/core/src/components/menu/types.ts @@ -21,7 +21,7 @@ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import { type ElementType } from "react"; +import { type ElementType, type MouseEvent } from "react"; import { type AriaProps, type BadgeType, @@ -77,7 +77,7 @@ export interface MenuItemProps /** * click handler */ - onClick?: () => CallbackReturn; + onClick?: (e: MouseEvent) => CallbackReturn; } export interface MenuRootProps extends CssProp { diff --git a/packages/core/src/components/tabpanel/Tab.tsx b/packages/core/src/components/tabpanel/Tab.tsx index 2ab11a2..bbc4781 100644 --- a/packages/core/src/components/tabpanel/Tab.tsx +++ b/packages/core/src/components/tabpanel/Tab.tsx @@ -83,6 +83,10 @@ export interface TabProps * close handler */ onClose?: () => CallbackReturn; + /** + * click handler + */ + onClick?: (id: string) => CallbackReturn; } export const Tab = ({