Preserve QWord caret while typing
This commit is contained in:
@@ -280,6 +280,15 @@ export function QWord({ document, zoom = 100, onChange, onStatusChange }: QWordP
|
||||
const activeRibbonTabLabel = wordRibbonTabs.find((tab) => tab.id === activeRibbonTab)?.label ?? "Главная";
|
||||
const stageClassName = ["document-stage", `qword-view-${viewMode}`].join(" ");
|
||||
|
||||
useLayoutEffect(() => {
|
||||
const editor = editorRef.current;
|
||||
if (!editor || editor.innerHTML === document.html) {
|
||||
return;
|
||||
}
|
||||
|
||||
editor.innerHTML = document.html;
|
||||
}, [document.html]);
|
||||
|
||||
function currentPageFromStage(pageCount: number, pageHeight: number) {
|
||||
const stage = stageRef.current;
|
||||
const editor = editorRef.current;
|
||||
@@ -1021,7 +1030,6 @@ export function QWord({ document, zoom = 100, onChange, onStatusChange }: QWordP
|
||||
onKeyUp={rememberActiveTableCell}
|
||||
onMouseDown={rememberActiveTableCellFromEvent}
|
||||
onMouseUp={rememberActiveTableCellFromEvent}
|
||||
dangerouslySetInnerHTML={{ __html: document.html }}
|
||||
aria-label="Содержимое документа"
|
||||
/>
|
||||
{pageView.count > 1 ? (
|
||||
|
||||
Reference in New Issue
Block a user