Composition transaction inside of Aurelia Dialog

Has anyone successfully used composition transactions within an Aurelia dialog (Aurelia 1x)? I came upon a very old issue that seemed to have been closed without a fix. Eisenberg mentioned that dialogs didn’t incorporate the transactional composition mechanism.

Ultimately, I have a custom component inside an Aurelia dialog where the composition transaction enlist/done behavior is being completely ignored (see #367 for the example I based it off of). I created a separate custom element outside of a dialog and it works fine.

I can try creating a gist to recreate my problem, but figured I’d ask here first.

1 Like

Composition transaction is a mechanism to allow any component at any level to hook into a composition and request a handle to delay the completion of a composition.
In a dialog creation, there’s no composition transaction so even if you request a handle, it wouldn’t affect the behavior of the dialog composition.

What you can do is to create a new composition transaction for the container that creates the dialog:

const dialogCompositionTransaction = new CompositionTransaction();
const dialogContainer = someContainer.createChild();

dialogContainer.registerInstance(CompositionTransaction, dialogCompositionTransaction)

then from the root of your dialog composition, you can wait for it to be completed (maybe in activate method or so)