Skip to content

Commit 6bdc2e5

Browse files
author
Hwashiang Yu
committed
MC-15238: Live edit in Safari and Firefox puts caret at start of field after typing
- Resolved incorrect width calculation after the fix for fixing the command right resolution
1 parent 25b95b4 commit 6bdc2e5

File tree

2 files changed

+8
-2
lines changed
  • app/code/Magento/PageBuilder/view/adminhtml/web

2 files changed

+8
-2
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/buttons/preview.js

Lines changed: 4 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/content-type/buttons/preview.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,11 @@ export default class Preview extends PreviewCollection {
291291
return 0;
292292
}
293293
const widthProperties = ["paddingLeft", "paddingRight", "borderLeftWidth", "borderRightWidth"];
294+
const buttonText = buttonItem.find("[data-element='link_text']");
295+
const textWidth = buttonText.css("display", "inline-block").width();
296+
buttonText.css("display", "");
294297
return widthProperties.reduce((accumulatedWidth, widthProperty): number => {
295298
return accumulatedWidth + (parseInt(buttonItem.css(widthProperty), 10) || 0);
296-
}, buttonItem.find("[data-element='link_text']").width());
299+
}, textWidth);
297300
}
298301
}

0 commit comments

Comments
 (0)