File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
packages/compass-connections-navigation/src Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 1- import React , { useState , useEffect } from 'react' ;
1+ import React , {
2+ useState ,
3+ useEffect ,
4+ forwardRef ,
5+ ButtonHTMLAttributes ,
6+ } from 'react' ;
27import {
38 css ,
49 Icon ,
@@ -17,18 +22,26 @@ const menuItemStyles = css({
1722type ConnectMenuItemProps = {
1823 action : Actions ;
1924 glyph : GlyphName ;
20- } & Omit < MenuItemProps , 'glyph' > ;
25+ } & Omit <
26+ MenuItemProps & ButtonHTMLAttributes < HTMLButtonElement > ,
27+ 'glyph' | 'as'
28+ > ;
2129
22- function ConnectMenuItem ( { action, glyph, ...rest } : ConnectMenuItemProps ) {
30+ export const ConnectMenuItem = forwardRef <
31+ HTMLButtonElement ,
32+ ConnectMenuItemProps
33+ > ( function ConnectMenuItem ( { action, glyph, ...rest } , ref ) {
2334 return (
2435 < MenuItem
36+ as = "button"
2537 data-action = { action }
2638 className = { menuItemStyles }
2739 glyph = { < Icon glyph = { glyph } /> }
2840 { ...rest }
41+ ref = { ref }
2942 />
3043 ) ;
31- }
44+ } ) ;
3245
3346// Hack to make SplitButton consider this as a MenuItem
3447ConnectMenuItem . displayName = 'MenuItem' ;
You can’t perform that action at this time.
0 commit comments