Skip to content

Commit

Permalink
fix(): do not emit change event when manual setting value
Browse files Browse the repository at this point in the history
  • Loading branch information
weareoutman committed Sep 24, 2024
1 parent a9e4f69 commit 2b6f920
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bricks/vs/src/code-editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -806,14 +806,16 @@ export function CodeEditorComponent({
return;
}
const currentModel = editorRef.current.getModel()!;
const listener = currentModel.onDidChangeContent(async () => {
const listener = currentModel.onDidChangeContent(async (e) => {
setEditorId(workerId);

if (["brick_next_yaml"].includes(language)) {
embeddedModelProcessor(currentModel, editorRef.current!.getPosition()!);
// debounceParse();
}
onChange(currentModel.getValue());
if (!e.isFlush) {
onChange(currentModel.getValue());

Check warning on line 817 in bricks/vs/src/code-editor/index.tsx

View check run for this annotation

Codecov / codecov/patch

bricks/vs/src/code-editor/index.tsx#L817

Added line #L817 was not covered by tests
}
});
return () => {
listener.dispose();
Expand Down

0 comments on commit 2b6f920

Please sign in to comment.