Prevent .onmatch from being called in an assertion is generated in the dialog.

fixes #3170