wwf
2 天以前 a430284aa21e3ae1f0d5654e55b2ad2852519cc2
app/components/base/prompt-editor/plugins/on-blur-or-focus-block.tsx
@@ -37,16 +37,14 @@
      ),
      editor.registerCommand(
        BLUR_COMMAND,
        (event) => {
          // Check if the clicked target element is var-search-input
          const target = event?.relatedTarget as HTMLElement
          if (!target?.classList?.contains('var-search-input')) {
            ref.current = setTimeout(() => {
              editor.dispatchCommand(KEY_ESCAPE_COMMAND, new KeyboardEvent('keydown', { key: 'Escape' }))
            }, 200)
            if (onBlur)
              onBlur()
          }
        () => {
          ref.current = setTimeout(() => {
            editor.dispatchCommand(KEY_ESCAPE_COMMAND, new KeyboardEvent('keydown', { key: 'Escape' }))
          }, 200)
          if (onBlur)
            onBlur()
          return true
        },
        COMMAND_PRIORITY_EDITOR,