InfomediaLtd / angular2-materialize

Angular 2 support for Materialize CSS framework.
https://infomedialtd.github.io/angular2-materialize/
MIT License
407 stars 140 forks source link

Callback function for onCloseEnd parameter is always being invoked #429

Open raintomista opened 6 years ago

raintomista commented 6 years ago

Hi!

I'm trying to reset a form of a dismissible modal using the onCloseEnd parameter. However, it seems that the resetLoginForm() is always being invoked by the code snippet below even if the modal is not dismissed yet. <div id="login-box" class="modal" materialize="modal" [materializeActions]="loginModal [materializeParams]="[{endingTop: '25%', onCloseEnd: resetLoginForm()}]">

The form becomes unusable since the form keeps on resetting.

Any help would be appreciated!

aron9forever commented 6 years ago

Having the same issue, the function is spammed constantly and on any random action (mouseovers, nothing to do with modal). Tried this way as well

onCloseParams = [{ onCloseEnd: () => { console.log('ay'); } }]; then [materializeParams]="onCloseParams"

Doing it this way will just not do anything at all, the function never gets called. Code copied from https://github.com/InfomediaLtd/angular2-materialize/issues/354#issuecomment-323865208