Ich möchte hinzufügen – Jahre später hatte ich dasselbe Problem (hatte keinen Zugriff auf toolbarEvent innerhalb eines Modals) und diese Lösung hat auch für mich funktioniert.
api.onToolbarCreate((toolbar) => {
toolbar.addButton({
...
sendAction: (event) =>
toolbar.context.send("triggerMyModal", event),
...
});
});
api.modifyClass("component:d-editor", {
modal: service(),
pluginId: "poll",
actions: {
triggerMyModal(toolbarEvent) {
this.modal.show(MyCustomModal, {
model: {
toolbarEvent,
},
});
},
},
});
Danke für die Hilfe, Keegan.