Bug #89173
Updated by Andreas Kienast about 5 years ago
If a notification with actions is triggered within an iframe, the actions are broken after the iframe document changes. This is due to broken scopes when the notification is generated.
Following code is invoked in list_frame which renders a notification:
<pre>
require(['TYPO3/CMS/Backend/Notification', 'TYPO3/CMS/Backend/ActionButton/DeferredAction'], function(Notification, DeferredAction) {
Notification.info('Foo', 'Yadda yadda.', 0, [
{
label: 'Revert\u0020update',
action: new DeferredAction(function() {
return new Promise(resolve => setTimeout(() => { console.log('DONE'); resolve('foobar'); }, 1000));
})
}
]);
});
</pre>
If e.g. another backend module is loaded, the click event in the notification gets lost _and_ the callback cannot be executed anymore.