File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @togglecorp/toggle-ui" ,
3- "version" : " 0.16.0-beta.6 " ,
3+ "version" : " 0.16.0-beta.7 " ,
44 "description" : " React component library by togglecorp" ,
55 "files" : [
66 " /build"
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export interface PopupButtonProps<N extends number | string | undefined> extends
1919 persistent : boolean ;
2020 arrowHidden ?: boolean ;
2121 defaultShown ?: boolean ;
22+ elementRef ?: React . RefObject < HTMLButtonElement > ;
2223}
2324function PopupButton < N extends number | string | undefined > ( props : PopupButtonProps < N > ) {
2425 const {
@@ -32,12 +33,15 @@ function PopupButton<N extends number | string | undefined>(props: PopupButtonPr
3233 arrowHidden,
3334 persistent,
3435 defaultShown,
36+ elementRef,
3537 ...otherProps
3638 } = props ;
3739
38- const buttonRef = React . useRef < HTMLButtonElement > ( null ) ;
40+ const internalButtonRef = React . useRef < HTMLButtonElement > ( null ) ;
3941 const popupRef = React . useRef < HTMLDivElement > ( null ) ;
4042
43+ const buttonRef = elementRef ?? internalButtonRef ;
44+
4145 const [ popupShown , setPopupShown ] = React . useState ( defaultShown ?? false ) ;
4246
4347 useEffect (
You can’t perform that action at this time.
0 commit comments