Skip to content

Commit 9210de3

Browse files
fix: prevent infinite render loop when selecting all content (#1956)
1 parent 75c4d03 commit 9210de3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/core/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,14 @@ export class FormattingToolbarView implements PluginView {
206206
// individually in each button.
207207
const newReferencePos = this.getSelectionBoundingBox();
208208

209-
// Workaround to ensure the correct reference position when rendering
209+
// Workaround to ensure the correct reference position when rendering
210210
// React components. Without this, e.g. updating styles on React inline
211-
// content causes the formatting toolbar to be in the wrong place. We
212-
// know the component has not yet rendered if the reference position has
211+
// content causes the formatting toolbar to be in the wrong place. We
212+
// know the component has not yet rendered if the reference position has
213213
// zero dimensions.
214214
if (
215215
newReferencePos.x === 0 ||
216216
newReferencePos.y === 0 ||
217-
newReferencePos.width === 0 ||
218217
newReferencePos.height === 0
219218
) {
220219
// Updates the reference position again following the render.

0 commit comments

Comments
 (0)