Skip to content

Commit 3625f13

Browse files
committed
fix: image ribbon gallery gets unresponsive after successful completion as tag markers are updated
1 parent 33f508c commit 3625f13

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3668,6 +3668,7 @@ function RemoteFunctions(config = {}) {
36683668
"finishEditing" : finishEditing,
36693669
"hasVisibleLivePreviewBoxes" : hasVisibleLivePreviewBoxes,
36703670
"dismissUIAndCleanupState" : dismissUIAndCleanupState,
3671+
"dismissImageRibbonGallery" : dismissImageRibbonGallery,
36713672
"registerHandlers" : registerHandlers
36723673
};
36733674
}

src/LiveDevelopment/LivePreviewEdit.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,13 @@ define(function (require, exports, module) {
706706
// if editor is not available we directly write the image file name as the src value
707707
_updateImageSrcAttribute(tagId, uniqueFilename);
708708
}
709+
710+
// after successful update we dismiss the image ribbon gallery
711+
// to ensure that the user doesn't work with image ribbon gallery on a stale DOM
712+
const currLiveDoc = LiveDevMultiBrowser.getCurrentLiveDoc();
713+
if (currLiveDoc && currLiveDoc.protocol && currLiveDoc.protocol.evaluate) {
714+
currLiveDoc.protocol.evaluate("_LD.dismissImageRibbonGallery()");
715+
}
709716
}
710717
});
711718
})

0 commit comments

Comments
 (0)