File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -54,12 +54,20 @@ export namespace ButtonProps {
5454 export type AsAnchor = {
5555 linkProps : RegisteredLinkProps ;
5656 onClick ?: never ;
57+ nativeButtonProps ?: never ;
5758 disabled ?: never ;
5859 type ?: never ;
5960 } ;
6061 export type AsButton = {
6162 linkProps ?: never ;
6263 onClick : React . MouseEventHandler < HTMLButtonElement > ;
64+ nativeButtonProps ?: Omit <
65+ React . DetailedHTMLProps <
66+ React . ButtonHTMLAttributes < HTMLButtonElement > ,
67+ HTMLButtonElement
68+ > ,
69+ "onClick"
70+ > ;
6371 disabled ?: boolean ;
6472 /** Default "button" */
6573 type ?: "button" | "submit" | "reset" ;
@@ -79,6 +87,7 @@ export const Button = memo(
7987 size = "medium" ,
8088 linkProps,
8189 onClick,
90+ nativeButtonProps,
8291 disabled,
8392 type,
8493 ...rest
@@ -124,6 +133,7 @@ export const Button = memo(
124133 </ Link >
125134 ) : (
126135 < button
136+ { ...nativeButtonProps }
127137 className = { className }
128138 type = { type }
129139 title = { title }
Original file line number Diff line number Diff line change @@ -62,7 +62,13 @@ const { meta, getStory } = getStoryFactory({
6262 "disabled" : {
6363 "control" : { "type" : "boolean" }
6464 } ,
65+ "nativeButtonProps" : {
66+ "description" : `Can be used to attach extra props to the underlying native button.
67+ Example: \`{ "aria-controls": "fr-modal-1", onMouseEnter: event => {...} }\`` ,
68+ "control" : { "type" : null }
69+ } ,
6570 "children" : {
71+ "description" : "The label of the button" ,
6672 "control" : { "type" : "string" }
6773 }
6874 } ,
You can’t perform that action at this time.
0 commit comments