Skip to content

Commit

Permalink
Add a note
Browse files Browse the repository at this point in the history
  • Loading branch information
smoores-dev committed Aug 14, 2023
1 parent 7f4a754 commit 77a1abf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/components/EditorView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ export function EditorView(props: Props) {
<DocNodeView
{...mountProps}
ref={(el) => {
// TODO: This should probably be happening in a hook.
// In fact, this looks almost identical to useEditorView;
// we can almost certainly use exactly that hook here.
if (reactEditorView?.dom == el) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useSyncSelection.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useEffect } from "react";

import { EditorViewInternal } from "../prosemirror-view/EditorViewInternal.js";
import { EditorView } from "../prosemirror-view/index.js";
import { selectionToDOM } from "../prosemirror-view/selection.js";

export function useSyncSelection(view: EditorViewInternal | null) {
export function useSyncSelection(view: EditorView | null) {
useEffect(() => {
if (!view) return;

Expand Down

0 comments on commit 77a1abf

Please sign in to comment.