From 1f49bd167dfab2ba2ec88dd4942708ff826a1c31 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 19 Nov 2022 20:18:55 -0500 Subject: [PATCH] fix: Flash of misaligned floating images upon loading --- shared/editor/nodes/Image.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/shared/editor/nodes/Image.tsx b/shared/editor/nodes/Image.tsx index 1cb7d72b0..a88932e70 100644 --- a/shared/editor/nodes/Image.tsx +++ b/shared/editor/nodes/Image.tsx @@ -120,12 +120,12 @@ const getLayoutAndTitle = (tokenTitle: string): TitleAttributes => { return attributes; } - if (IMAGE_CLASSES.includes(tokenTitle)) { - attributes.layoutClass = tokenTitle; - IMAGE_CLASSES.map((className) => { + IMAGE_CLASSES.map((className) => { + if (tokenTitle.includes(className)) { + attributes.layoutClass = className; tokenTitle = tokenTitle.replace(className, ""); - }); - } + } + }); const match = tokenTitle.match(imageSizeRegex); if (match) {