foundation-apps icon indicating copy to clipboard operation
foundation-apps copied to clipboard

Bug with zf-advise on a zf-modal

Open mattgrande opened this issue 8 years ago • 2 comments

I have a modal that looks like this:

<div zf-modal="" zf-advise id="formModal" role="dialog" animation-in="slideInUp" animation-out="slideOutDown">

And I'm subscribed to it like this:

FoundationApi.subscribe( 'formModal', function( action ) {
        console.info('subscribe/formModal', action);
});

That function gets the open, close, and active-false actions. However, it does not get the active-true action.

After some playing around in the Foundation code, it seems that the active-true is trying to be published against the <aside> tag that gets generated within the zf-modal, rather than the zf-modal itself.

In my case, I've been able to subscribe to an empty string:

FoundationApi.subscribe( '', function( action ) {
        console.info('subscribe/formModal', action);
});

but I can't imagine that's desired behaviour.

mattgrande avatar Mar 29 '16 19:03 mattgrande

@mattgrande I'm not sure if it would help, but I made some changes to how zf-advise works in the framework (https://github.com/zurb/foundation-apps/pull/741). I've only ever needed to use zf-advise for panels, not modals, so these changes may not fix your issue.

soumak77 avatar Mar 29 '16 19:03 soumak77

Thanks @soumak77! I'll check that out in awhile!

mattgrande avatar Mar 29 '16 19:03 mattgrande