🐛(frontend) fix children not display when first resize

When we resize the window for the first time, then
open the panel, the children were not displayed.
This fix this issue.
This commit is contained in:
Anthony LC
2025-12-22 09:43:04 +01:00
parent e4b8ffb304
commit b78ad27a71
3 changed files with 6 additions and 4 deletions

View File

@@ -20,6 +20,7 @@ and this project adheres to
### Fixed
- 🐛(frontend) fix tables deletion #1752
- 🐛(frontend) fix children not display when first resize #1753
## [4.2.0] - 2025-12-17

View File

@@ -172,7 +172,10 @@ export const DocSubPageItem = (props: TreeViewNodeProps<Doc>) => {
emoji={emoji}
withEmojiPicker={doc.abilities.partial_update}
defaultIcon={
<SubPageIcon color="var(--c--contextuals--content--semantic--info--tertiary)" />
<SubPageIcon
color="var(--c--contextuals--content--semantic--info--tertiary)"
style={{ flexShrink: 0 }}
/>
}
$size="sm"
docId={doc.id}

View File

@@ -63,13 +63,11 @@ export const DocTree = ({ currentDoc }: DocTreeProps) => {
});
treeContext?.treeData.handleMove(result);
};
/**
* This function resets the tree states.
*/
const resetStateTree = useCallback(() => {
if (!treeContext?.root?.id) {
return;
}
treeContext?.setRoot(null);
setInitialOpenState(undefined);
}, [treeContext]);