materialize icon indicating copy to clipboard operation
materialize copied to clipboard

Modal onComplete isn't fired on jQuery closeModal

Open ev5unleash opened this issue 10 years ago • 3 comments

Hi there,

I'm currently initiating some modals with code like this:

$('#dynamicModal').openModal({ complete: function() { onRequestHide(); }}); // Callback for Modal open});

It works great if a user clicks outside of the modal to close it, however if a modal is closed my jQuery like this:

$('#dynamicModal').closeModal();

The onComplete callback doesn't it fired. Is there any way we could bake this into the closeModal method? It's useful for me and my users to close a modal (especially if it's a dynamic one) via buttons with a jQuery call.

Thanks, Evan

ev5unleash avatar May 03 '16 18:05 ev5unleash

Initialize your modal with leanModal. openModal and closeModal are methods without options

acburst avatar May 04 '16 02:05 acburst

leanModal initialization with options depends on a trigger button. How do you set options on a modal that is only opened programmatically? in other words no trigger

jenwebb avatar Aug 14 '16 03:08 jenwebb

I am having this same problem and need a solution. I know openModal takes LeanModalOptions because I successfully pass in a LeanModalOptions object that sets the modal options correctly. The modal is both opened and closed programmatically rather than via user input. Here's the weird thing: a ready function fires, but my complete function does not. It's driving me crazy!

IRCraziestTaxi avatar Sep 15 '16 22:09 IRCraziestTaxi