🐛(frontend) table of content disappearing
The table of content was disappearing when the user was looking the version history then came back to the main document. This commit fixes this issue.
This commit is contained in:
@@ -16,6 +16,11 @@ and this project adheres to
|
|||||||
|
|
||||||
- 🧑💻(docker): add .next to .dockerignore #1055
|
- 🧑💻(docker): add .next to .dockerignore #1055
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
🐛(frontend) table of content disappearing #982
|
||||||
|
|
||||||
|
|
||||||
## [3.3.0] - 2025-05-06
|
## [3.3.0] - 2025-05-06
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -178,7 +178,6 @@ export const BlockNoteEditorVersion = ({
|
|||||||
initialContent,
|
initialContent,
|
||||||
}: BlockNoteEditorVersionProps) => {
|
}: BlockNoteEditorVersionProps) => {
|
||||||
const readOnly = true;
|
const readOnly = true;
|
||||||
const { setEditor } = useEditorStore();
|
|
||||||
const editor = useCreateBlockNote(
|
const editor = useCreateBlockNote(
|
||||||
{
|
{
|
||||||
collaboration: {
|
collaboration: {
|
||||||
@@ -193,15 +192,6 @@ export const BlockNoteEditorVersion = ({
|
|||||||
},
|
},
|
||||||
[initialContent],
|
[initialContent],
|
||||||
);
|
);
|
||||||
useHeadings(editor);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setEditor(editor);
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
setEditor(undefined);
|
|
||||||
};
|
|
||||||
}, [setEditor, editor]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box $css={cssEditor(readOnly)} className="--docs--editor-container">
|
<Box $css={cssEditor(readOnly)} className="--docs--editor-container">
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export const useHeadings = (editor: DocsBlockNoteEditor) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setHeadings(editor);
|
setHeadings(editor);
|
||||||
|
|
||||||
editor?.onEditorContentChange(() => {
|
editor?.onChange(() => {
|
||||||
setHeadings(editor);
|
setHeadings(editor);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user