Skip to content

Commit b24ab3a

Browse files
committed
MC-3775: Button editable state is not consistent with the options panel appearing
- Ensure focusedButton never gets set to -1
1 parent 9ef308b commit b24ab3a

File tree

2 files changed

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

2 files changed

+5
-2
lines changed

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

Lines changed: 3 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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ export default class Preview extends PreviewCollection {
154154

155155
createButtonItemPromise.then((button: ContentTypeInterface) => {
156156
this.parent.addChild(button);
157-
this.focusedButton(this.parent.children().indexOf(button));
157+
const buttonIndex = this.parent.children().indexOf(button);
158+
this.focusedButton(buttonIndex > -1 ? buttonIndex : null);
158159
return button;
159160
}).catch((error: Error) => {
160161
console.error(error);

0 commit comments

Comments
 (0)