Using Bootstrap 4 Modal with a touch of jquery-ui datepicker

Greetings! I have recently upgraded Bootstrap from version 3.3.X to 4.1 and am encountering an issue with modals not behaving as expected.

Within a standard bootstrap Modal box on a page, the code looks like this:

<!-- language:all lang-html -->
<div class="modal fade" id="myModal" role="dialog" data-backdrop="static">   
  <div class="modal-dialog">     
    <div class="modal-content">       
      <div class="modal-header modal-header-success">         
        <h1 class="modal-title"></h1>
        <button type="button" class="close" data-dismiss="modal">&times;</button>       
      </div>       
      <div class="modal-body">
        //Content with jquery-ui DatePickers and Tooltips using absolute positioning
      </div>
    </div>
  </div>
</div>

To give the modal box a maximum height nearly equal to the viewport height with a vertical scrollbar if needed, I added the following CSS:

CSS:
#myModal .modal-body { max-height: calc(100vh - 200px); overflow-y: auto; }

The issue arises when the DatePickers and tooltips within the modal appear "under" the modal backdrop and create an unwanted horizontal scrollbar if they are near the border. The previous version of Bootstrap handled this differently by displaying these elements on top of the backdrop when necessary.

I am seeking a workaround in Bootstrap 4 to achieve the same behavior as in Bootstrap 3. Adjusting z-index values or setting overflow-x to visible did not yield the desired results due to stacking context related to display flex.

While avoiding scenarios where these elements reach the border is one approach, I am interested in exploring potential workarounds.

I have created a Fiddle example to demonstrate the issue with hovering tooltips, which also applies to DatePickers:

https://jsfiddle.net/psarag/g7dr1tcs/46/

Thank you for your assistance!

Answer №1

To style your span tag, apply the following CSS:

display: none;
position: absolute;
z-index: 9999;
border: 1px solid black;
background-color: rgb(255, 255, 212);
color: rgb(51, 51, 51);

This styling will result in a look similar to this image: https://i.sstatic.net/04VbY.png

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

Guide on adding the contents of non-empty <td> tags using Javascript or JQuery

My goal is to calculate the total sum of all the HTML content within <td> elements with the attribute name='gross_val'. Here are the <td> elements I am working with: <tr><td name="gross_val" align="right" title="gross_val1" ...

The three.js library encountered an ERROR 404 ( File Not Found ) when trying to import an existing file

Error: GET http://localhost:port/js/three net::ERR_ABORTED 404 (Not Found) I am currently working on a web development project using Three JS. I downloaded the master Zip of ThreeJS from the official website of Three JS I copied the JS files from the Bui ...

What is causing the breakdown of bordered tables in Bootstrap when the border-separate property is set to collapse?

I am experiencing an issue with my bordered table that is using the Bootstrap classes table table-bordered. When I add border-collapse: separate, the borders are correctly separated, but the top and bottom borders seem to disappear due to zero width. I am ...

Create two divs that have a width of 50%, forming perfect squares

Is there a way to create two div elements like these? Even if the gray area shrinks, the two div elements will remain visually consistent. While I can use box-sizing: border-box; and padding: 50% 0; in the red box, I need to include text in the blue b ...

Lock in the top row (header row)

In a node.js application: How can I lock the top row of a table in place, similar to Excel's freeze panes feature? I think this might involve using some CSS styling, but I'm not exactly sure how to achieve it. When I tried using fixed, the entir ...

Troubleshooting inactive CSS hover animation

Greetings! I'm facing an issue with a CSS hover animation. Here are two demos I've created: In the first DEMO, the animation works perfectly. However, in the second DEMO, it doesn't seem to be functioning. On the second demo, there are two ...

Alter the color of the initially chosen option in the dropdown selection

I'm struggling to modify the color of the initial selection while keeping the remaining selection-options at their default black color. Unfortunately, I haven't been successful in achieving this. Currently, all colors are #ccc. What I want is fo ...

Trouble with CSS navigation

Hello! In Dreamweaver, I have completed the design for my navigation bar. Here is how it looks: However, when I view it in Firefox, the navigation appears all jumbled up. It's quite frustrating... Below is the code that I'm using: #navbar { ...

Unable to choose radio button again

Check out this fun web quiz I created! I'm having some trouble with the back button functionality. Whenever a user clicks back, I want to restore their previous choice but for some reason it's not working as expected. Take a look at my go_back ...

Customize the appearance of semantic-ui-react components with hover effects

When I assign a specific className to components like <Segment className="Change" color='blue' inverted></Segment> and then in my CSS I apply the following: .Change:hover{ background-color: black; //or any other hover effect } N ...

Setting the width of the Bootstrap 4 container as a percentage

How can the main page container be properly sized as a percentage of the screen? While a "container-fluid" fills the entire view point, setting a % on the "container" class may not be valid. Is it possible to adjust margins and padding to achieve the desi ...

Is there a way to include a textarea or text input in a table row and have it expand upon clicking or dragging, without increasing the row height?

I am looking for a way to allow a textarea to expand or grow when clicked or dragged, without affecting the height of the table row it is in. You can see an example of the issue on this CodePen: https://codepen.io/kerastensorflow/pen/PobaRvK?editors=1010 ...

Angular4 encountered an error: $(...).DataTable is not recognized as a function

I utilized the bootstrap4 datatable jQuery function within my Angular4 application to construct a sortable table. Below is the code snippet. .component.ts import { Component } from '@angular/core'; declare var $: any; @Component({ template ...

Is it possible to decrease the size of a div by scrolling both vertically and horizontally?

Can a div's height and width both be reduced at the same time while scrolling down a page? Let's say that as the user scrolls, the size of the div changes from 400px by 400px to 200px by 200px, all while remaining centered on the page. I've ...

Having issues with JavaScript interacting with the DOM

I'm a beginner in web programming and I'm struggling to understand why the code below isn't working as expected. It should permanently remove the content of the div element when the button is pressed, but instead, it disappears briefly and ...

Neglecting images on Zoom

Looking to scale up the elements on an HTML page by 50%, without affecting the resolution of images. Despite trying zoom: 150% in CSS3, it ends up zooming pictures as well, resulting in blurry visuals. Is there a way to enlarge all HTML components while ...

Saving a dynamically generated table in a PHP session to display every time the current user logs in

This specific table is generated based on the user's selection of values in the drop-down menus. How can we store this dynamically generated table in a session so that it appears every time the current user logs in? <table border="0" class="table ...

Is it possible for CKEditor Plugin to extend allowedContent to elements further down the hierarchy, or is there a way to deactivate the MagicLine for specific elements?

I am in the process of developing a Drupal module that is inspired by the CKEditor Accordion Module, but with a twist of using Bootstrap 4 instead. The generated HTML markup by this module looks something like this: <section class="accordion" id="Acco ...

Instructions for submitting a form using Xcode

How can I automate the submission of a form in a webview? Here is my code: #import <Cocoa/Cocoa.h> #import <WebKit/WebKit.h> #import <WebKit/WebResourceLoadDelegate.h> @interface AppDelegate : NSObject <NSApplicationDelegate> @pro ...

Whenever I navigate to a new page in my NEXTJS project, it loads an excessive number of modules

I am currently working on a small Next.js project and facing an issue where the initial load time is excessively long. Whenever I click on a link to navigate to a page like home/product/[slug], it takes around 12 seconds to load due to compiling over 2000 ...