From df920114d69df5dda2d639e52426e9a058fa7108 Mon Sep 17 00:00:00 2001 From: olga-kulish Date: Thu, 14 Nov 2024 16:00:28 +0300 Subject: [PATCH] fix: gapmatch/hottext/choice: image wrap: ckeditor console error --- src/mediaEditor/plugins/mediaAlignment/helper.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mediaEditor/plugins/mediaAlignment/helper.js b/src/mediaEditor/plugins/mediaAlignment/helper.js index ecb811f1..5f5300c7 100644 --- a/src/mediaEditor/plugins/mediaAlignment/helper.js +++ b/src/mediaEditor/plugins/mediaAlignment/helper.js @@ -81,7 +81,11 @@ export const positionFloat = function positionFloat(widget, position) { if (!context.featureFlags['FEATURE_FLAG_DISABLE_FIGURE_WIDGET'] && prevClassName !== className) { // Re-build Figure widget to toggle between inline/block - const parent = searchRecurse(widget.element.bdy.rootElement.bdy, widget.serial); + const parent = searchRecurse(widget.element.rootElement.bdy, widget.serial); + // If it's Image not Figure (Choice, GapMatch/HotText qti-flow-container) + if (!parent) { + return; + } // If Figure is not in A-block (Prompt, TextReader PCI) if (parent.contentModel === 'inlineStatic' || widget.$container.closest('.qti-customInteraction').length) { _.defer(() => {