This is an automated email from the ASF dual-hosted git repository.
robin0716 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/answer-plugins.git
The following commit(s) were added to refs/heads/main by this push:
new 71fb6a2 fix(editor-stacks/Component): enhance onChange plugin to
include editor instance reference
71fb6a2 is described below
commit 71fb6a27d348ffea1fa216b5d59b46feddcd2f65
Author: robin <[email protected]>
AuthorDate: Thu Dec 25 18:35:56 2025 +0800
fix(editor-stacks/Component): enhance onChange plugin to include editor
instance reference
---
editor-stacks/Component.tsx | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/editor-stacks/Component.tsx b/editor-stacks/Component.tsx
index a870fbe..05c1e4a 100644
--- a/editor-stacks/Component.tsx
+++ b/editor-stacks/Component.tsx
@@ -132,9 +132,12 @@ const Component: FC<EditorProps> = ({
: undefined,
editorPlugins: onChange
? [
- createOnChangePlugin((content) => {
- onChangeRef.current?.(content);
- }),
+ createOnChangePlugin(
+ () => editorInstanceRef.current,
+ (content: string) => {
+ onChangeRef.current?.(content);
+ }
+ ),
]
: [],
});