The side modal features a full-height design with headers, bodies, and footers that are

I have created a side modal that extends to full height. The content in the modal body is quite lengthy, but I am facing an issue where the header, body, and footer are not equal in size. I am considering using scrollspy on the HTML body tag to potentially fix this. Your assistance in resolving this matter would be greatly appreciated. Thank you.

Below is the code for my modal:

<div class="modal fade right" id="modalPoll" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"
      data-backdrop="false">
      <div class="modal-dialog modal-full-height modal-right modal-notify modal-info" role="document">
        <div class="modal-content">
          <!--Header-->
          <div class="modal-header">
            <p class="heading lead">Feedback request
            </p>
         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true" class="white-text">×</span>
            </button>
          </div>
      <!--Body-->
          <div class="modal-body" >
            <div class="text-center">
              <i class="fa fa-file-text-o fa-4x mb-3 animated rotateIn"></i>
              <p>
                <strong>Your opinion matters</strong>
              </p>
              <p>Have some ideas how to improve our product?
                <strong></strong>Give us your feedback.</strong>
              </p>
            </div>
            <hr>
       <!-- Radio -->
            <p class="text-center">
              <strong>Your rating</strong>
            </p>
            <div class="form-check mb-4">
          <input class="form-check-input" name="group1" type="radio" id="radio-179" value="option1" checked>
          <label class="form-check-label" for="radio-179">Very good</label>
        </div>
        <div class="form-check mb-4">
          <input class="form-check-input" name="group1" type="radio" id="radio-279" value="option2">
          <label class="form-check-label" for="radio-279">Good</label>
        </div>
        <div class="form-check mb-4">
          <input class="form-check-input" name="group1" type="radio" id="radio-379" value="option3">
          <label class="form-check-label" for="radio-379">Mediocre</label>
        </div>
        <div class="form-check mb-4">
          <input class="form-check-input" name="group1" type="radio" id="radio-479" value="option4">
          <label class="form-check-label" for="radio-479">Bad</label>
        </div>
        <div class="form-check mb-4">
          <input class="form-check-input" name="group1" type="radio" id="radio-579" value="option5">
          <label class="form-check-label" for="radio-579">Very bad</label>
        </div>
            <!-- Radio -->
        <p class="text-center">
              <strong>What could we improve?</strong>
            </p>
            <!--Basic textarea-->
            <div class="md-form">
              <textarea type="text" id="form79textarea" class="md-textarea form-control" rows="3"></textarea>
              <label for="form79textarea">Your message</label>
            </div>
            </div>
          <!--Footer-->
          <div class="modal-footer justify-content-center">
            <a type="button" class="btn btn-primary waves-effect waves-light">Send
              <i class="fa fa-paper-plane ml-1"></i>
            </a>
            <a type="button" class="btn btn-outline-primary waves-effect" data-dismiss="modal">Cancel</a>
          </div>
        </div>
      </div>
    </div>

Below is the current output of the modal: https://i.sstatic.net/KbvUB.png https://i.sstatic.net/dPyD3.png

Answer №1

Implement sticky-top on the modal-header

  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
  
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalPoll">Open modal</button>

<div class="modal fade right" id="modalPoll" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" id="myModal"
      data-backdrop="false">
      <div class="modal-dialog modal-full-height modal-right modal-notify modal-info" role="document">
        <div class="modal-content">
          <!--Header-->
          <div class="modal-header sticky-top bg-primary">
            <p class="heading lead">Request for Feedback
            </p>
         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true" class="white-text">×</span>
            </button>
          </div>
      <!--Body-->
          <div class="modal-body" >
            <div class="text-center">
              <i class="fa fa-file-text-o fa-4x mb-3 animated rotateIn"></i>
              <p>
                <strong>Your Feedback is Important</strong>
              </p>
              <p>Do you have suggestions to enhance our product?
                <strong>Share your feedback.</strong>
              </p>
            </div>
            <hr>
       <!-- Radio -->
            <p class="text-center">
              <strong>Your Rating</strong>
            </p>
            <div class="form-check mb-4">
          <input class="form-check-input" name="group1" type="radio" id="radio-179" value="option1" checked>
          <label class="form-check-label" for="radio-179">Excellent</label>
        </div>
        <div class="form-check mb-4">
          <input class="form-check-input" name="group1" type="radio" id="radio-279" value="option2">
          <label class="form-check-label" for="radio-279">Good</label>
        </div>
        <div class="form-check mb-4">
          <input class="form-check-input" name="group1" type="radio" id="radio-379" value="option3">
          <label class="form-check-label" for="radio-379">Average</label>
        </div>
        <div class="form-check mb-4">
          <input class="form-check-input" name="group1" type="radio" id="radio-479" value="option4">
          <label class="form-check-label" for="radio-479">Poor</label>
        </div>
        <div class="form-check mb-4">
          <input class="form-check-input" name="group1" type="radio" id="radio-579" value="option5">
          <label class="form-check-label" for="radio-579">Very Poor</label>
        </div>
            <!-- Radio -->
        <p class="text-center">
              <strong>Areas for Improvement?</strong>
            </p>
            <!--Basic textarea-->
            <div class="md-form">
              <textarea type="text" id="form79textarea" class="md-textarea form-control" rows="3"></textarea>
              <label for="form79textarea">Your Comments</label>
            </div>
            </div>
          <!--Footer-->
          <div class="modal-footer justify-content-center">
            <a type="button" class="btn btn-primary waves-effect waves-light">Submit
              <i class="fa fa-paper-plane ml-1"></i>
            </a>
            <a type="button" class="btn btn-outline-primary waves-effect" data-dismiss="modal">Cancel</a>
          </div>
        </div>
      </div>
    </div>

Answer №2

Swap out your modal-content div with:

<div class="modal-content py-0" style="max-height: 100%; overflow-y: auto;">...</div>

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

What could be causing my CSS transitions to fail when using jQuery to add classes?

I'm currently working on a website and I'm facing an issue with the transition not functioning as expected. The problem persists even when the 7.css stylesheet is removed and interestingly, the transition works fine when using window:hover. My a ...

mdDialog showcasing beautiful JSON in a modal

I am trying to display formatted JSON in an Angular mdModal. Below is the code I am using: testVm.showPopup = function(id, data, ev) { var jsonPrettified = JSON.stringify(JSON.parse(data), null, 2); $mdDialog.show({ ...

Executing functions from within a VueJS component using included bootstrap or jQuery scripts in the template/layout

As a beginner in VueJS, I am looking to create an Admin Dashboard using the SB Admin Pro bootstrap template that we have already purchased. While BootstrapVUE is available, we are committed to utilizing the specific template we own. My Objective: Within o ...

"Unlock the Power of Reactjs Material: Simplifying the Process of Passing Props to Reactjs Material Dialog

Is there a way to pass props to a material dialog in ReactJS? When I try < FormDialog value={this.prop.value} />, I get an error saying Type '{ value: any; }' is not assignable to type 'IntrinsicAttributes'. How can I specify the ...

react-full-page is causing my webpage to not open in a specific ID location, such as http://localhost:3000/#someIdWhereIWantThePageToBeOpened

I'm currently utilizing the react-full-page package and while it's almost working well, I've come across two issues: After clicking on an anchor link like <a href='#someId'>Go There</a>, the scroll goes to the designat ...

Ensure that the Materialize CSS modal form remains open even after submission

Is there a way to reload a form inside a materialize modal with empty fields without closing the modal after submitting? The issue is that currently, when the submit button is clicked, the modal closes and redirects. <div class="modal" id="docM ...

Follow us text placed in front of social sprite images all aligned on the same line

Is there a way to align the Follow Us text with sprite images? Check out this jsfiddle link for more details! <ul class="social_Emp">&nbsp;&nbsp;&nbsp;Follow us: <li class="Emp_twitter"><a href="{if $userInfo.TwitterPage} {$u ...

What is the method for incorporating opacity into the background color CSS attribute using a Fluent UI color?

Currently, my challenge involves applying opacity to a background color sourced from the fluent UI library, which utilizes Design Tokens. Typically, I would add opacity to a background color like this: background-color: "rgba(255, 255, 255, 0.5)" However ...

Rows that intersect - Challenging to articulate - Bootstrap 3

I'm at a loss for words when trying to describe what I'm attempting without simply showing you a picture: The issue I'm encountering is that the search box's height isn't fixed, and I might want to include other elements on the le ...

Increasing the size of the .ui-btn-left component

Seeking advice on a Javascript query that I can't seem to resolve online. As a beginner in Javascript, I'm struggling with what seems like a simple issue. My dilemma lies in enlarging the close button on a jQuery page. .ui-dialog .ui-header .ui- ...

Tips for utilizing flexbox to position a button to the right of an InputSelect

Struggling to position a button next to a dropdown? No matter what I attempt, the button keeps ending up above the dropdown. Ideally, I'd like it to appear alongside 'Select Organisation' as shown in the image below: https://i.sstatic.net/w ...

Tips for merging two classes in CSS

Within my code, I have two classes named classA and classB. I am looking to have classB inherit the style of classA while still only using classB. .classA{ width:100px;} .classB{ height:100px;} <div class="classB"></div> ...

Styling with CSS: Shifting an Element with each adjustment in page width

Within my project, there is a basic div that serves as a navigation bar. Inside this div rests an image portraying a logo. My goal is for the position of the logo to adjust every time the page width is altered. I attempted using media queries for this pu ...

What is the best way to make a Modal triggered by a loop embedded within a table function properly on mobile devices?

While the modal is functioning properly on desktop, it seems to be encountering issues on mobile devices. The modal appears behind the background and is confined by the boundaries of the table (tbody). Below is the code snippet for triggering the modal: ...

Expand row size in grid for certain row and item

For my project, I am utilizing a Grid layout to display 5 items per row. https://i.sstatic.net/PW6Gu.png Upon clicking on an item, my goal is to have the item detail enlarge by increasing the size of the HTML element. https://i.sstatic.net/nGj8l.png Is t ...

Customize Your Form Labels with Bootstrap: Changing Label Color in Forms

I am completely new to using bootstrap, particularly bootstrap 3. The goal I have is to change the color of labels such as "Name", "Email Address", "Phone Number" and "Message" from dark grey to white in the design shown below. https://i.sstatic.net/yDTto ...

What causes my CSS styles to vanish upon refreshing the page in Next.js?

After setting up a CSS folder within my app directory and importing the files into components for use, I noticed that the styles are applied initially. However, upon refreshing the page, they all disappear. I attempted to resolve this issue by going back ...

How can ngx-modals detect when the modals have been closed?

I have integrated ngx-modals into my project and I am looking to add a boolean value to it. When the modals open, I want to set this boolean to "true", and when they close, I need it to be set to "false". Regardless of whether the modal is closed using the ...

What is the best way to implement a CSS transition in React when the state changes, the component remounts, or it re-rend

Imagine having a React functional component with some basic state: import React, { useState } from 'react' import { makeStyles } from "@material-ui/core" export default function Cart() { const [itemNumber, setItemNumber] = useState ...

Leveraging backstretch.js in combination with blur.js (or equivalent)

Query Update I provided a response to the query below, however, I am experiencing some lag and a noticeable stepped transition between images. Can anyone offer advice on how to optimize this issue? Perhaps it would be better to go back to using a static ...