Skip to content

Commit 08502be

Browse files
author
Hwashiang Yu
committed
MC-843: Heading live edit should become unfocused on drag action
- Removed draggable try catch block and replaced with hasfocus validation
1 parent fd16c0e commit 08502be

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/binding/draggable.js

Lines changed: 1 addition & 3 deletions
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/binding/draggable.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ import ko from "knockout";
1313
ko.bindingHandlers.draggable = {
1414
init(element, valueAccessor) {
1515
$(element).on("mousedown", () => {
16-
try {
16+
if (document.hasFocus()) {
1717
(document.activeElement as HTMLElement).blur();
1818
}
19-
catch (error) {
20-
console.error(error);
21-
}
2219
}).draggable(valueAccessor());
2320
},
2421
};

0 commit comments

Comments
 (0)