Skip to content

Commit c5d2860

Browse files
#692: Fix skipped MFTF tests after Chrome update
- fix sortable when dropping to hidden content type
1 parent bb5bf78 commit c5d2860

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/drag-drop/sortable.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/drag-drop/sortable.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,11 @@ function onSortUpdate(preview: Preview, event: Event, ui: JQueryUI.SortableUIPar
251251

252252
// jQuery tries to reset the state but kills KO's bindings, so we'll force a re-render on the content type
253253
if (ui.item.length > 0 && typeof ko.dataFor(ui.item[0]) !== "undefined") {
254-
const contentType = ko.dataFor(ui.item[0]).parentContentType as ContentTypeCollectionInterface;
254+
const data = ko.dataFor(ui.item[0]);
255+
const contentType = data.contentType && data.contentType.getChildren ?
256+
data.contentType as ContentTypeCollectionInterface :
257+
data.parentContentType as ContentTypeCollectionInterface;
258+
255259
const children = contentType.getChildren()().splice(0);
256260
contentType.getChildren()([]);
257261
contentType.getChildren()(children);

0 commit comments

Comments
 (0)