File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/format-types/highlight Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -119,10 +119,10 @@ const HighlightButton = props => {
119119
120120 // Close the window if the user clicks outside.
121121 const clickOutsideListener = useCallback ( event => {
122- if ( isOpen ) {
123- if ( ! isElementDescendant ( popoverEl . current , event . target ) && ! event . target . closest ( '.components-popover ' ) ) {
124- setIsOpen ( false )
125- }
122+ const isOutside = ! isElementDescendant ( popoverEl . current , event . target )
123+ const isToolbarButton = event . target . closest ( '.stk- components-toolbar__highlight ' )
124+ if ( isOpen && isOutside && ! isToolbarButton ) {
125+ setIsOpen ( false )
126126 }
127127 } )
128128
@@ -175,7 +175,7 @@ const HighlightButton = props => {
175175 < Toolbar className = "stackable-components-toolbar" >
176176 < Button
177177 label = { __ ( 'Color & Highlight' , i18n ) }
178- className = "components-toolbar__control stk-toolbar-button"
178+ className = "components-toolbar__control stk-toolbar-button stk-components-toolbar__highlight "
179179 icon = "editor-textcolor"
180180 aria-haspopup = "true"
181181 tooltip = { __ ( 'Color & Highlight' , i18n ) }
You can’t perform that action at this time.
0 commit comments