Skip to content

Commit 31f4611

Browse files
author
Hwashiang Yu
committed
MC-3732: Buttons Do Not Display As Same Width After Page Refresh When There's A Lot Of Page Content
-Added event listener to listen for buttons and button item after render
1 parent 07cdc8e commit 31f4611

File tree

2 files changed

+24
-0
lines changed
  • app/code/Magento/PageBuilder/view/adminhtml/web

2 files changed

+24
-0
lines changed

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

Lines changed: 12 additions & 0 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/content-type/buttons/preview.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ export default class Preview extends PreviewCollection {
4444
}
4545
});
4646

47+
events.on("buttons:renderAfter", (args: ContentTypeDroppedCreateEventParamsInterface) => {
48+
if (args.id === this.parent.id) {
49+
this.resizeChildButtons();
50+
}
51+
});
52+
53+
events.on("button-item:renderAfter", (args: ContentTypeDroppedCreateEventParamsInterface) => {
54+
if (args.contentType.parent.id === this.parent.id) {
55+
this.resizeChildButtons();
56+
}
57+
});
58+
4759
events.on("stage:updateAfter", (eventData: StageUpdateAfterParamsInterface) => {
4860
_.debounce(() => {
4961
this.resizeChildButtons();

0 commit comments

Comments
 (0)