From ac9d910e1e77c559eff8b32cd8412335f41074f1 Mon Sep 17 00:00:00 2001
From: Cynthia <cynthia@cynthia.dev>
Date: Sun, 3 Nov 2024 18:18:27 +0100
Subject: fix(a11y): avoid plain `div`s as button or tabs (#6084)

Co-authored-by: Hailey <me@haileyok.com>
---
 src/components/Menu/index.tsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/components/Menu/index.tsx')

diff --git a/src/components/Menu/index.tsx b/src/components/Menu/index.tsx
index 4d35a63bd..a171e9772 100644
--- a/src/components/Menu/index.tsx
+++ b/src/components/Menu/index.tsx
@@ -46,7 +46,7 @@ export function Root({
   return <Context.Provider value={context}>{children}</Context.Provider>
 }
 
-export function Trigger({children, label}: TriggerProps) {
+export function Trigger({children, label, role = 'button'}: TriggerProps) {
   const {control} = React.useContext(Context)
   const {state: focused, onIn: onFocus, onOut: onBlur} = useInteractionState()
   const {
@@ -70,6 +70,7 @@ export function Trigger({children, label}: TriggerProps) {
       onPressIn,
       onPressOut,
       accessibilityLabel: label,
+      accessibilityRole: role,
     },
   })
 }
-- 
cgit 1.4.1

