I have a dialog that I open with:
(<any>$(this.showAnswersModal.nativeElement)).foundation('open');
I have a close button in the dialog that works (closes the dialog) if I am running debug through IntelliJ, but it will not close the dialog if I am not running debug with IntelliJ. Pressing and/or clicking outside of the dialog closes it whether in debug or not.
Turns out that I had the event code in the HTML (template) file wrong. I had missed the parenthesis.
I had:
(onCloseButtonClicked)="onClose"
I should have had:
(onCloseButtonClicked)="onClose()"
So initially, the event handler never got called, which contained the code to close the dialog, but the dialog still got closed in debug somehow. The code that wasn't getting called in the component initially was:
private onClose() {
(<any>$(this.showModal.nativeElement)).foundation('close');
}
Somehow running it in IntelliJ debug still closed the dialog when I clicked the close button.