Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #17695
Closed
Open
Issue created Sep 24, 2015 by Administrator@rootContributor

Dynamically loaded Bootstrap Modal does not scroll on iOS 9

Created by: jkrehm

Using Bootstrap 3, when I load content into a modal on the show event, scrolling on iOS 9 devices does not work. It works correctly on every other device that I've tried, including iOS 8. I think the DOM doesn't update the

's scroll height, so it doesn't think the modal should be scrollable. The handleUpdate function doesn't fix the issue, either.

I've created a minimal example on Codepen at http://codepen.io/jkrehm/full/LpRzJV/ (code available here).

The most relevant code is this:

// Show loader & then get content when modal is shown
$modal.on('show.bs.modal', function(e) {
    $(this).find('.modal-body')
        .html('loading...')
        .load('https://baconipsum.com/api/?type=meat-and-filler&paras=10', function() {
            // Use Bootstrap's built-in function to fix scrolling (to no avail)
            $modal.modal('handleUpdate');
        });
});

If I change the code so the content is loaded before the modal is shown, things work fine, but there's no loading indicator for the user (just a pause of indeterminate length after they click the button and before the modal appears).

What can we do to convince iOS 9 to recalculate the .modal-body's scroll height? I've tried a number of things, and the only "work around" that works reliably is to hide .modal-body and show it again.

I've also created a StackOverflow question in case someone else runs into the issue and figures out a fix.

Assignee
Assign to
Time tracking