File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
gui/src/components/mainInput/tiptap Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -153,14 +153,24 @@ function TipTapEditor(props: TipTapEditorProps) {
153153 setActiveKey,
154154 } ) ;
155155
156+ const handleBlur = ( e : React . FocusEvent ) => {
157+ // Check if the new focus target is within our InputBoxDiv
158+ const currentTarget = e . currentTarget ;
159+ const relatedTarget = e . relatedTarget as Node | null ;
160+
161+ if ( relatedTarget && currentTarget . contains ( relatedTarget ) ) {
162+ return ;
163+ }
164+
165+ setShouldHideToolbar ( true ) ;
166+ } ;
167+
156168 return (
157169 < InputBoxDiv
158170 onFocus = { ( ) => {
159171 setShouldHideToolbar ( false ) ;
160172 } }
161- onBlur = { ( ) => {
162- setShouldHideToolbar ( true ) ;
163- } }
173+ onBlur = { handleBlur }
164174 onKeyDown = { handleKeyDown }
165175 onKeyUp = { handleKeyUp }
166176 className = { shouldHideToolbar ? "cursor-default" : "cursor-text" }
You can’t perform that action at this time.
0 commit comments