Comments (14)
it is still happening. Finally I am manually removing "modal-open" from body.
from angular-modal-service.
Instead of using a timeout, a more reliable solution is to use the promise
returned by the modal's hide
method (or show
method, if you are doing this in reverse). The promise is resolved when animation completes, so you can enqueue you the second animation to the end of the first.
here's a working example: https://embed.plnkr.co/iLS5H2MmY5MWZ0i8KMDM/
here's the gist:
// animation is complete when the promise resolves.
// set the initial state of the promise to resolved, so we
// can open the modal without having to write extra code
var modalIsAnimating = $q.resolve();
$scope.closeModal = function() {
modalIsAnimating = $scope.modal.hide();
};
$scope.openModal = function() {
modalIsAnimating.then(function () {
$scope.modal.show();
});
};
(fyi: I am assuming that the issue occurs when opening the modal shortly after closing it... this is how I have experienced the issue)
from angular-modal-service.
+1 ... As far as I have observed, when ng-class is also used on the body tag, or any element where the modal is targeted, this issue arises, otherwise it works just fine
from angular-modal-service.
I believe this can be caused by the modal('hide') being called before the fade animation has fully completed. (http://stackoverflow.com/questions/11519660/twitter-bootstrap-modal-backdrop-doesnt-disappear)
As a quick solution removing the 'fade' class from the modal will make it work.
from angular-modal-service.
Try changing the line:
close(res, 200);
to
close(res, 500);
and see if that helps - that'll give the animation more time to run before the modal content is destroyed.
from angular-modal-service.
Thanks @dwmkerr , it worked.
Sorry I did not try this before ...
from angular-modal-service.
@skylve Great, glad it worked!
from angular-modal-service.
I have identical issue.
It works only when I manually remove modal-open class from body.
Increasing time doesn't work.
// this works fine
$element.on 'hidden.bs.modal', close
//this is not working
$scope.save, = ->
close({ allDone: true }, 5000)
from angular-modal-service.
Cool, I've got the same issue, that is, sometimes the modal backdrop does not get removed from the body tag. Only sometimes ;) I had 200 msec specified in the close function. Modified to 500, and now seems to be stable! It'd be a good idea to add this to the FAQ.
from angular-modal-service.
no, I was too quick. This still happens to me sometimes, and I don't get why.
from angular-modal-service.
Anyone find a solution for this besides setting timeout?
from angular-modal-service.
+1 I still have same issue
from angular-modal-service.
My issue was commented html code inside the html file used by the modal. The commented HTML wasn't inside the modal tags , it was a separate enclosed div tags but was still on the html file .Once I removed the commented html div it resolved the backdrop issue
from angular-modal-service.
+1 same issue. In my scenario I am closing the modal and in then() launch a popover, after dismissing popover ui is unresponsive and modal-open is still attached to body...
from angular-modal-service.
Related Issues (20)
- ModalService.closeModals() - Dont close other modals HOT 2
- modal dismiss HOT 4
- Memory leak HOT 2
- modal is not showing up but code js is ok
- Modal not getting closed HOT 3
- Modal service not working with bootstrap 4 beta (popper.js issue)
- Request: Upgrade to Angular 2 (and higher) HOT 2
- Browser support for angular-modal-service HOT 2
- doing operations on modal close HOT 1
- An in-range update of karma is breaking the build 🚨 HOT 15
- Close callback being called multiple times when location changes
- null is not an object (evaluating 'r.resolve')
- request: make it compatible with AngularJS 1.7 HOT 1
- Jquery datepicker not open issue in modal HOT 1
- An in-range update of webpack is breaking the build 🚨 HOT 21
- Latest version capture any angular error through the modal service
- Component bindings are bound too late HOT 3
- Can't overlay modals HOT 1
- An in-range update of uglify-js is breaking the build 🚨 HOT 22
- Close in a single controller?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-modal-service.