File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import ButtonPresenter from "./presenters/ButtonPresenter";
14
14
15
15
const Button = ( props ) => {
16
16
const {
17
+ buttonRef,
17
18
disabled,
18
19
icon,
19
20
link,
@@ -54,6 +55,7 @@ const Button = (props) => {
54
55
onMouseUp : handleMouseUp ,
55
56
} ) => (
56
57
< ButtonPresenter
58
+ buttonRef = { buttonRef }
57
59
disabled = { disabled }
58
60
hasFocus = { hasFocus }
59
61
hasHover = { hasHover }
@@ -89,12 +91,16 @@ Button.defaultProps = {
89
91
} ;
90
92
91
93
Button . propTypes = {
94
+ /**
95
+ * A callback ref that gets passed to the HTML button
96
+ */
97
+ buttonRef : PropTypes . func ,
92
98
/**
93
99
* Prevents user interaction with the button
94
100
*/
95
101
disabled : PropTypes . bool ,
96
102
/**
97
- * A @hig /icon element
103
+ * A @weave-design /icon element
98
104
*/
99
105
icon : PropTypes . node ,
100
106
/**
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
14
14
15
15
const ButtonPresenter = ( props ) => {
16
16
const {
17
+ buttonRef,
17
18
disabled,
18
19
hasFocus,
19
20
hasHover,
@@ -61,6 +62,7 @@ const ButtonPresenter = (props) => {
61
62
return (
62
63
< Wrapper
63
64
{ ...otherProps }
65
+ ref = { buttonRef }
64
66
className = { cx ( css ( cssStyles . button ) , className ) }
65
67
href = { href }
66
68
tabIndex = { tabIndex }
@@ -97,6 +99,7 @@ const ButtonPresenter = (props) => {
97
99
ButtonPresenter . displayName = "ButtonPresenter" ;
98
100
99
101
ButtonPresenter . propTypes = {
102
+ buttonRef : PropTypes . func ,
100
103
disabled : PropTypes . bool ,
101
104
hasFocus : PropTypes . bool ,
102
105
hasHover : PropTypes . bool ,
You can’t perform that action at this time.
0 commit comments