Hi @Edward,
When a page is being used as a dialog, the is no event that is dipatched or exposed for the close icon.
But you can use the snippet code below which uses event delegation — attach the listener to a stable parent (the dialog) and check the click target:
const dialog = this;
dialog.addEventListener(‘click’, (event) => {
if (event.target.id === ‘xdialog-delete’) {
console.log(‘Delete SVG clicked via delegation’);
}
});
That should work.