File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ const BlockToolbar = ({
144144 < div className = "Draftail-BlockToolbar" ref = { toolbarRef } >
145145 < Tooltip
146146 shouldOpen = { visible }
147- onHide = { ( ) => setVisible ( false ) }
147+ onClickOutside = { ( ) => setVisible ( false ) }
148148 placement = { comboPlacement }
149149 zIndex = { tooltipZIndex }
150150 showBackdrop = { showBackdrop }
@@ -179,7 +179,7 @@ const BlockToolbar = ({
179179 className = "Draftail-BlockToolbar__trigger"
180180 style = { { top : focusOffset } }
181181 aria-label = { triggerLabel }
182- onClick = { ( ) => setVisible ( true ) }
182+ onClick = { ( ) => setVisible ( ! visible ) }
183183 >
184184 { triggerIcon }
185185 </ button >
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ export interface TooltipProps {
6868 zIndex ?: number ;
6969 placement ?: TooltipPlacement ;
7070 onHide ?: ( ) => void ;
71+ onClickOutside ?: ( ) => void ;
7172 onMount ?: ( instance : PopperInstance ) => void ;
7273}
7374
@@ -80,6 +81,7 @@ const Tooltip = ({
8081 zIndex = 100 ,
8182 placement = "top" as TooltipPlacement ,
8283 onHide,
84+ onClickOutside,
8385 onMount,
8486} : TooltipProps ) => {
8587 const parentRef = useRef < HTMLDivElement > ( null ) ;
@@ -121,7 +123,7 @@ const Tooltip = ({
121123 visible = { visible }
122124 interactive
123125 onHide = { onHide }
124- onClickOutside = { onHide }
126+ onClickOutside = { onClickOutside || onHide }
125127 onMount = { onMount }
126128 placement = { placement }
127129 maxWidth = "100%"
You can’t perform that action at this time.
0 commit comments