Fixed snippet creation from email-cta card's toolbar

no issue

- Glimmer components do not have a `.element` property so we need to set it manually because the editor currently reaches into card components to calculate the element's rect for selection when creating snippets
This commit is contained in:
Kevin Ansfield 2021-08-24 10:12:52 +01:00
parent d45ba1aa78
commit de480234e9
2 changed files with 8 additions and 0 deletions

View File

@ -17,6 +17,7 @@
@moveCursorToPrevSection={{@moveCursorToPrevSection}}
@moveCursorToNextSection={{@moveCursorToNextSection}}
@editor={{@editor}}
{{did-insert this.registerElement}}
as |card|
>
{{#if @isEditing}}

View File

@ -114,6 +114,13 @@ export default class KoenigCardEmailCtaComponent extends Component {
}
}
// required for snippet rects to be calculated - editor reaches in to component,
// expecting a non-Glimmer component with a .element property
@action
registerElement(element) {
this.element = element;
}
@action
updateHtml(html) {
this._updatePayloadAttr('html', html);