Troubleshooting Problems with Bootstrap 4 Modal Scrolling on Mobile Devices

When I try to scroll down on a modal launched using Bootstrap 4, I am unable to reach the bottom of the content. It works perfectly fine on desktop browsers like Chrome, Firefox, and Safari in responsive web design modes.

However, when I switch to an iPhone and use Chrome, Firefox, or Safari, scrolling to the bottom becomes difficult. I suspect that this issue is related to where the modal originates from within the main content, but I am not entirely certain.

If anyone has any advice on this matter, I would greatly appreciate it. I have been struggling with this for a few hours now, even though it seems like a minor problem.

Below is the CSS code for reference:

        /* @MEDIA QUERIES */
        @media (max-width: 480px) {

        html,
        body {
            overflow-y: auto;
            height: 100%;
        }

        .footer {
            margin-top: 10px;
            font-size: 10px;
        }

        #formQuestionList {
            margin: 20px 0px 0px -20px;
            font-size: 10px;
        }

        .modal { 
            top: 20px !important; 
            bottom: 20px !important;
            right: 5%; 
            left: 5%;
            width: auto; 
            margin: 0; 
        }

        #formsModal {
            /* padding: 100px 0px 100px 0px; */
            overflow-y: auto;
        }

        #instructionsModal {
            overflow-y: hidden;
        }

        .modal-open .modal .modal-dialog {
            max-height: 100%;
        }
                    
        .video-btn, .form-btn {
            font-size: 18px;
        }

        #selectInfo {
            font-size: 13px;
        }

        #instructionsList {
            font-size: 11px;
        }

        .modal-footer {
            display: flex;
            justify-content: center;
        }

HTML:

<!-- Forms Modal -->
        <div class="modal fade" id="formsModal" role="dialog">
            <div class="modal-dialog" id="formsDialog">
                <div class="modal-content">
                    <div class="modal-header formHeader">
                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                        <h4 class="form-title"><span id='formType'></span></h4>
                    </div>
                    <div class="modal-body">
                        <form id='questionsForm'>
                            <div class="form-group">
                                <ol id="formQuestionList">

                                </ol>
                            </div>
                        </form>
                        <button id="submitForm" type="button" class="btn btn-primary">Submit Form</button>
                    </div>
                </div>
            </div>
        </div>

Answer №1

I updated your CSS to only include font sizes, and the problem has been resolved:

@media (max-width: 480px) {

    .footer {
        font-size: 10px;
    }

    #formQuestionList {
        font-size: 10px;
    }

    .video-btn, .form-btn {
        font-size: 18px;
    }

    #selectInfo {
        font-size: 13px;
    }

    #instructionsList {
        font-size: 11px;
    }
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

"Troubleshooting a jittery React sticky header during scrolling: Dealing with IntersectionObserver and CSS

My current project involves implementing a sticky header in a React application using the Carbon framework. The goal is to have a sticky header with a bottom border when users scroll up, providing context for their viewing experience. However, when they sc ...

Troubleshooting a responsive design problem with iosSlider CSS configuration

After downloading the iosSlider demo, I decided to make some modifications to one of the examples provided. To access iosSlider, visit . Click on the big red button to download the demo. The specific index.html file I am trying to edit can be found in th ...

Get the child element from a list within an element using XPath on Sales Navigator

I am attempting to extract the names and positions of random individuals from Sales Navigator. Each person is displayed as a card containing all their information. Despite obtaining a list of these cards, I am struggling to retrieve the Name and Title for ...

Strange new alignment when using float

Looking to arrange a series of menus using the float and clearfix method, but encountering some issues. Specifically, trying to align the menu group to the right without setting a uniform width due to varying text lengths. However, adding padding causes th ...

Utilizing nested classes in CSS or SCSS for calling a class within another class

I am having trouble calling a class within another class. Can someone help me figure out how to do it? Here is the HTML code: <div class="main">Content</div> <div class="cover">Cover content</div> And here is t ...

What is the step-by-step process for implementing basic data validation in PHP?

Is there a way to implement a basic validation that checks for empty inputs? I am looking to create a simple validation process in PHP that displays an error if any form field is left empty. The aim is to only proceed with adding the input values to the d ...

Preventing CSS background images from loading remotely due to content security policy restrictions

I am facing an issue where a background image loaded from a remote server is being blocked by my CSP with the following message Content Security Policy: The page's settings blocked the loading of a resource at self ("default-src * "). Source: b ...

Using CSS to design a table-like structure with rows that span multiple columns

I am trying to generate a table dynamically using CSS and a JSON array. For example: In the code snippet provided, I have assigned a class of 'spannedrow' to span certain cells in the table, although the class is not defined yet. This is just ...

The page width seems incredibly wide right now, and I'm having trouble pinpointing which CSS element is responsible for this

My website is on Wordpress and the page widths seem to be too wide. I have tried looking for the culprit in the code, but so far no luck... ...

Load images in an array using JavaScript and display them using the image source

I started by creating an array that contains several images function initialize(){ //adding 10 different images to the array imgArray[imageNum++] = new imageItem(imageDir + "img1.jpg"); imgArray[imageNum++] = new imageItem(imageDir + "img2.jpg"); imgArra ...

Arranging Bootstrap 4 Right Column at the Top in Mobile View

My webpage is built using Bootstrap 4 and the layout looks like this: <div class="row"> <div class="col-md-8"> Content A </div> <div class="col-md-4"> Content B </div> </div> It displays ...

The NextRouter failed to mount

Currently, I am in the process of incorporating a search functionality into my property rental application. I have successfully added the Nextjs Router to handle the routing. However, when attempting to access localhost:3000/search, an error is encountered ...

The arrangement of columns is not correctly aligned

My website layout is giving me trouble. I want to create a three column design, but unfortunately, it's not aligning properly. Each subsequent column is being pushed down slightly more than the previous one. Is there any way to fix this issue? Interes ...

Navigating the process of implementing a change in product image upon hovering

I am in the process of creating a shopping cart that will feature product thumbnails displayed in a single column on the left side and a large main product image. When a user hovers over a thumbnail image, I want the main image to change to display the hov ...

Steps to creating a proper cascade using the label statement

I am currently customizing the appearance of a checkbox. The HTML code in the file called fin1.cfm is as follows: <td>Master Event:</td> <td> <input type = "checkbox" id = "cb_e" name = "datesumm" value = "" > <label f ...

Targeting an outer div based on checkbox status: a comprehensive guide

How can I target a div when a user checks a checkbox? Any advice on how to select an outer div when the checkbox is checked? ...

Position <UL> at the center of <DIV>

I've attempted several solutions found on Stack Overflow to center my <UL> element, but nothing seems to work. Can someone please take a look at it? I am looking to center the text "Shop 943 01 ... not available". Thank you in advance. ...

Clear form input values when modal closes using jQuery Bootstrap

I am encountering an issue with a modal that contains a single form field. Once the user enters a value and closes the modal, the entered value remains when the modal is reopened. I need the form to reset every time the modal is dismissed so that it opens ...

Utilizing selected Bootstrap dropdown option for extracting value

I'm currently learning about development and am trying to create a bootstrap dropdown with 3 different background image options. My goal is to change the background based on the selected option from the dropdown. However, I am struggling to figure out ...

Alert: The form submission has been terminated due to the lack of connection in Angular

CSS Code: <style> .btn-info{ background-color: #5bc0de; color: white; padding: 10px 20px; border-radius: 5px; } </style> JavaScript Code: $sc ...