Skip to content

Commit 759ac66

Browse files
committed
Update setCanvasMinHeight call placing
1 parent 53220db commit 759ac66

File tree

1 file changed

+6
-7
lines changed
  • packages/editor/src/components/collab-sidebar

1 file changed

+6
-7
lines changed

packages/editor/src/components/collab-sidebar/comments.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export function Comments( {
170170
const offsets = {};
171171

172172
if ( ! isFloating ) {
173-
return offsets;
173+
return { offsets, minHeight: 0 };
174174
}
175175

176176
// Find the index of the selected thread.
@@ -188,7 +188,7 @@ export function Comments( {
188188
! selectedThreadData ||
189189
! blockRefs[ selectedThreadData.id ]
190190
) {
191-
return offsets;
191+
return { offsets, minHeight: 0 };
192192
}
193193

194194
let blockElement = blockRefs[ selectedThreadData.id ];
@@ -289,15 +289,14 @@ export function Comments( {
289289
lastThreadTop + lastThreadHeight + lastThreadOffset + 32;
290290
}
291291

292-
// Ensure the editor has enough height to scroll to all notes.
293-
setCanvasMinHeight( editorMinHeight );
294-
295-
return offsets;
292+
return { offsets, minHeight: editorMinHeight };
296293
};
297-
const newOffsets = calculateAllOffsets();
294+
const { offsets: newOffsets, minHeight } = calculateAllOffsets();
298295
if ( Object.keys( newOffsets ).length > 0 ) {
299296
setBoardOffsets( newOffsets );
300297
}
298+
// Ensure the editor has enough height to scroll to all notes.
299+
setCanvasMinHeight( minHeight );
301300
}, [
302301
heights,
303302
blockRefs,

0 commit comments

Comments
 (0)