Reputation: 11
Documentation - https://developer.salesforce.com/docs/component-library/bundle/lightning-modal/documentation - modal - API 56 When I try to fire an event from the modal window to the parent window - completely according to the example from the documentation - I get an error -
Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.
Completely according to the example from the documentation
this.dispatchEvent(new CustomEvent('select', {
detail: {
id: 42
}
}));
The error occurs even at the moment the event is sent - not to mention the moment it is received
I'm waiting for an event but it doesn't happen
Upvotes: 1
Views: 1863
Reputation: 1686
You have to enable Lightning Web Security Enabled in the org to get this working.
You can check this https://salesforce.stackexchange.com/questions/387924/lightning-modal-custom-event-not-working-in-winter-23-release
I've checked it myself and it's working well.
Upvotes: 0