Skip to content

Commit

Permalink
fix playboard
Browse files Browse the repository at this point in the history
  • Loading branch information
sailist committed Feb 9, 2025
1 parent 4f658e5 commit fac7c4f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions document/components/playboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const EditableManually: React.FC<EditableDivProps> = ({
anchorRef.current.innerText = anchorToString({
container: range.startContainer,
offset: range.startOffset,
});
}, true);
}
};

Expand Down Expand Up @@ -111,7 +111,7 @@ export const EditableManually: React.FC<EditableDivProps> = ({
anchorRef.current.innerText = anchorToString({
container: range.startContainer,
offset: range.startOffset,
});
}, true);
});
}, []);

Expand Down Expand Up @@ -186,10 +186,16 @@ export const EditablePlayable: React.FC<EditableDivProps> = ({
if (!divRef.current) {
return;
}
if (!editorRef.current) {
return;
}
divRef.current.focus();
editorRef.current?.resetAnchor({
editorRef.current.setAnchor({
container: divRef.current,
offset: 0,
}, {
rangeDirection: 'both',
collapsed: 'none',
});
setIsPlaying((prev) => {
if (!prev) {
Expand Down

0 comments on commit fac7c4f

Please sign in to comment.