improve default behaviour for consistency
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
							parent
							
								
									6424ffb22a
								
							
						
					
					
						commit
						4b27a67e33
					
				|  | @ -347,10 +347,18 @@ export class ContextMenu extends React.Component { | |||
| } | ||||
| 
 | ||||
| // Semantic component for representing the AccessibleButton which launches a <ContextMenu />
 | ||||
| export const ContextMenuButton = ({ label, isExpanded, children, ...props }) => { | ||||
| export const ContextMenuButton = ({ label, isExpanded, children, onClick, onContextMenu, ...props }) => { | ||||
|     const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); | ||||
|     return ( | ||||
|         <AccessibleButton {...props} title={label} aria-label={label} aria-haspopup={true} aria-expanded={isExpanded}> | ||||
|         <AccessibleButton | ||||
|             {...props} | ||||
|             onClick={onClick} | ||||
|             onContextMenu={onContextMenu || onClick} | ||||
|             title={label} | ||||
|             aria-label={label} | ||||
|             aria-haspopup={true} | ||||
|             aria-expanded={isExpanded} | ||||
|         > | ||||
|             { children } | ||||
|         </AccessibleButton> | ||||
|     ); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Michael Telatynski
						Michael Telatynski