Code Monkey home page Code Monkey logo

Comments (14)

garima2510 avatar garima2510 commented on May 25, 2024 4

it is still happening. Finally I am manually removing "modal-open" from body.

from angular-modal-service.

pmn4 avatar pmn4 commented on May 25, 2024 4

Instead of using a timeout, a more reliable solution is to use the promise returned by the modal's hidemethod (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.

rizwan-zakir-10p avatar rizwan-zakir-10p commented on May 25, 2024 1

+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.

geemanjs avatar geemanjs commented on May 25, 2024

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.

dwmkerr avatar dwmkerr commented on May 25, 2024

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.

skylve avatar skylve commented on May 25, 2024

Thanks @dwmkerr , it worked.
Sorry I did not try this before ...

from angular-modal-service.

dwmkerr avatar dwmkerr commented on May 25, 2024

@skylve Great, glad it worked!

from angular-modal-service.

sufleR avatar sufleR commented on May 25, 2024

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.

dszabo avatar dszabo commented on May 25, 2024

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.

dszabo avatar dszabo commented on May 25, 2024

no, I was too quick. This still happens to me sometimes, and I don't get why.

from angular-modal-service.

ionox0 avatar ionox0 commented on May 25, 2024

Anyone find a solution for this besides setting timeout?

from angular-modal-service.

almothafar avatar almothafar commented on May 25, 2024

+1 I still have same issue

from angular-modal-service.

AjOpon avatar AjOpon commented on May 25, 2024

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.

spc16670 avatar spc16670 commented on May 25, 2024

+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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.