From f5fa2fd6f8d59a3e2cccc7f5bb76eac69d1a43c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 7 Aug 2026 21:58:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=8A=A8=E4=BC=B8?= =?UTF-8?q?=E7=BC=A9=E6=96=87=E6=9C=AC=E6=A1=86=E4=BB=A3=E7=A0=81=E6=A3=80?= =?UTF-8?q?=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 整理 AutoGrowTextArea 导入顺序 补齐初始化配置的 Hook 依赖 --- src/components/common/AutoGrowTextArea.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/common/AutoGrowTextArea.tsx b/src/components/common/AutoGrowTextArea.tsx index 945f8d8af..51432883f 100644 --- a/src/components/common/AutoGrowTextArea.tsx +++ b/src/components/common/AutoGrowTextArea.tsx @@ -1,6 +1,8 @@ -import { ContentEditable } from '@lexical/react/LexicalContentEditable'; +import 'overlayscrollbars/styles/overlayscrollbars.css'; + import { LexicalComposer } from '@lexical/react/LexicalComposer'; import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'; +import { ContentEditable } from '@lexical/react/LexicalContentEditable'; import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary'; import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin'; import { PlainTextPlugin } from '@lexical/react/LexicalPlainTextPlugin'; @@ -17,12 +19,11 @@ import { COMPOSITION_START_COMMAND, INSERT_LINE_BREAK_COMMAND, KEY_ENTER_COMMAND, - PASTE_COMMAND, type LexicalEditor, + PASTE_COMMAND, } from 'lexical'; import type { PartialOptions } from 'overlayscrollbars'; import { useOverlayScrollbars } from 'overlayscrollbars-react'; -import 'overlayscrollbars/styles/overlayscrollbars.css'; import { type CSSProperties, useCallback, @@ -309,7 +310,7 @@ export function AutoGrowTextArea({ }, }), // LexicalComposer intentionally reads its initial configuration once. - [], + [disabled, readOnly], ); const resolvedClassName = [ 'auto-grow-text-area',