elbowz
elbowz

Reputation: 567

Template.myTemplate.destroyed and .modal('hide') not work

With new Meteor 0.8.0

If I use .destroyed (when change route) for hide a bootstrap modal, the tag

<div class="modal-backdrop fade in"></div> remain in <body>.

With precedent version of Meteor all work ok...could be new live template engine (blaze)?

edit:

if I add to "Template.myTemplate.destroyed": $('.modal-backdrop').remove(); $('body').removeClass('modal-open');

all works good...

Upvotes: 0

Views: 231

Answers (1)

Tarang
Tarang

Reputation: 75945

This behaviour is due to Meteor being a single paged app. In the previous version it would go away and this was the 'bug'. The behaviour where it stays where it is is actually the correct behaviour.

When going to a new route you should close the modal. This should get rid of the div, or at least hide it.

$('#<modal-id>').modal('hide');

Upvotes: 1

Related Questions