Skip to content

Commit

Permalink
don't update note when only selection has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
jaked committed Aug 3, 2021
1 parent 1c1621a commit aed34b9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/Main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import Frame, { FrameContextConsumer } from 'react-frame-component';
import { Range } from 'slate';

import Signal from '../util/Signal';

Expand Down Expand Up @@ -64,9 +63,9 @@ type RichEditorProps = {
}

const RichEditor = React.memo((props : RichEditorProps) => {
const { children, meta } = Signal.useSignal(props.content);
const { children } = Signal.useSignal(props.content);
const setValue = ({ children }: { children: PMAST.Node[] }) => {
props.content.setOk({ children, meta });
props.content.produce(value => { value.children = children });
}

return (
Expand Down

0 comments on commit aed34b9

Please sign in to comment.