Skip to content
This repository was archived by the owner on Dec 15, 2017. It is now read-only.

Update the hide method to fix scroll #241

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LiamKarlMitchell
Copy link

The datetime modal currently triggers 'hide', while the modal binding is expecting 'hidden.bs.modal'.
This causes the 'hidden' event to not get triggered, meaning that body scroll never gets re-enabled.

Bootstrap.js binds on hidden on the bs.modal so you want to trigger that.

    $(document)
        .on('show.bs.modal',  '.modal', function () { $(document.body).addClass('modal-open') })
        .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })

Otherwise the body tag will keep the modal-open tag and you cant scroll because it does overflow:none;
c9s added a commit to corneltek/bootstrap-datetimepicker that referenced this pull request May 23, 2016
c9s added a commit to corneltek/bootstrap-datetimepicker that referenced this pull request May 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant