The Bootstrap model popup darkens the screen, but there are a few areas that remain at the same level of brightness and do not get dim

https://i.sstatic.net/09QtK.png

Within my Angular 7 project, I have implemented a Bootstrap modal. However, I am facing an issue where only components with position: relative are darkened when the modal is opened. Some components have position: fixed, as shown in the screenshot below. Interestingly, all other components with z-index less than 2 do not darken when the modal popup appears.

 <div class="modal fade" *ngIf="deleteDialogOpened" id="deleteModal" tabindex="-1" role="dialog">
      <div class="modal-dialog modal-dialog-centered"  role="document">
        <div class="modal-content">
          <div class="modal-header " >
            <h5 class="modal-title">Confirmation</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
          </div>
          <div class="modal-body">
            <p style="margin-top: 20px; margin-bottom: 20px; text-align: left;">Are you sure you want to delete {{this.currentUser.firstName}}?</p>
          </div>
          <div class="modal-footer">
            <button class="btn btn-secondary" data-dismiss="modal" (click)="close('cancelDeleteDialog')">Cancel</button>
            <button class="submit-btn btn btn-elevate kt-login__btn-primary" data-dismiss="modal" (click)="close('delete')">Delete</button>
          </div>
        </div>
      </div>
    </div>

Answer №1

Consider placing the modal within a container div with the class "container" like so:


<div class="container">

<div class="modal fade" *ngIf="deleteDialogOpened" id="deleteModal" tabindex="-1" role="dialog">
      <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
          <div class="modal-header ">
            <h5 class="modal-title">Confirmation</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
          </div>
          <div class="modal-body">
            <p style="margin-top: 20px; margin-bottom: 20px; text-align: left;">Are you certain you wish to delete {{this.currentUser.firstName}}?</p>
          </div>
          <div class="modal-footer">
            <button class="btn btn-secondary" data-dismiss="modal" (click)="close('cancelDeleteDialog')">Cancel</button>
            <button class="submit-btn btn btn-elevate kt-login__btn-primary" data-dismiss="modal" (click)="close('delete')">Delete</button>
          </div>
        </div>
      </div>
    </div>

</div>

Answer №2

I just finished working on a new version for 5.3, which includes color mode support and jQuery integration. Additionally, I have added more options with a drop-down button feature. Check it out here: https://codepen.io/Anon-T/pen/WNKVpBz
Don't forget to include the HTML tag

<html len='en' data-bs-theme='light'>
and create your own button with JavaScript switching.

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

Unexpected blank space detected at the bottom of the page in Angular 13

Using the NGX-ADMIN template built on Angular 12 has been smooth sailing until an upgrade to Angular 13. With this simple version change, I am now faced with a perplexing issue that I can't seem to pinpoint or resolve. I can confidently say that shif ...

My webpage lacks responsiveness

I've recently put together an HTML page, but unfortunately, it's not responsive. My Code <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> ...

Issue with Npm installation command on Windows 7 64-bit system

When I run the command "npm install" from my project folder, I encounter the following errors: Error: Windows_NT 6.1.7601 Node version: v6.10.3 NPM version: v3.10.10 Code: ENOTFOUND Network error: getaddrinfo ENOTFOUND registry.npmjs.org regist ...

Troubleshooting: Issues with Mod_rewrite affecting CSS, JS, and Image functionality

Today marks my first time posting a query in this forum. I'm currently facing an issue with mod_rewrite. Below is the structure of my filesystem: site_new/stylesheets/layout.css site_new/javascript/somescript.js site_new/hallendetails.php ...

Tips for positioning an element so that it remains anchored to the content it is placed within

Hey Everyone! I'm struggling a bit with how to position the h2 headings in my code so that they stay fixed in the top right corner of the box while moving along with the rest of the contenthttps://i.stack.imgur.com/OOVaA.png%60 What I'm attempt ...

Adjust the width of the graphics on both sides of the text based on the length of the text content

Is there a way to center an H1 tag between two graphics using CSS or jquery/javascript? The width of the H1 text will vary depending on the page. The dot on the left should remain at the edge of the site, and the line should extend to meet the edge of the ...

What is the best sequence for loading angularjs, bootstrap, sp js libraries, and jquery?

I have a unique single application that requires the use of bootstrap, ui bootstrap, angularjs, and jquery. The functionality of the button below is working correctly, but I am experiencing issues with the styling. You can check out a sample of alerts here ...

How can I add text to the title of a border using Bootstrap5?

I am attempting to create a design where text appears within the border of an element. I am currently utilizing Bootstrap 5 and jQuery for this project. Despite my efforts with fieldset and legend elements, I have not been successful in achieving the desir ...

Cube with 3D attributes and text displayed on each face shatters upon reaching a specific time limit on Google Chrome (between

The issue appears to be specific to Chrome. In Chrome, the 3D cube's face or multiple faces become transparent, giving the appearance that the animation is breaking. Sometimes adding "backface-visibility" after the break can temporarily resolve the is ...

My router-outlet is malfunctioning when trying to display my component

I am currently diving into learning Angular 2 in order to revamp my personal website. However, I've encountered an issue where my application fails to load the component when I navigate to the appropriate route by clicking on the navigation bar. Insi ...

Creating a personalized audio player using HTML

I have created a design for an audio player that I would like to implement using the HTML audio player element. https://i.sstatic.net/vJpGg.jpg When I tried <audio></audio>, it just displayed the default player: https://i.sstatic.net/nyNj8.j ...

Angular 4 file upload verification: Ensuring safe and secure uploads

Is there a recommended method to validate the file type when uploading a file in an Angular 4 form? Are there any simple ways to accomplish this task? ...

"Enjoy a unique browsing experience with a two-panel layout featuring a fixed right panel that appears after scrolling

I am facing difficulty in designing a layout with two panels where the left panel has relative positioning and the right panel becomes fixed only after a specific scroll point. Additionally, I need the height of the right panel to adjust when the page scro ...

Angular 6 provides a regular expression that specifically targets the removal of any characters that are not numbers and enforces the allowance of

I have tried various solutions to restrict input in an Angular material input box, but none seem to be effective for my specific case. I need the input field to only allow numbers and a decimal point. Any other characters should be automatically removed as ...

Using Angular: A guide to importing an external library not found in NPM via Bower

I am trying to utilize a library that I obtained from a bower repository. Since it is not available in NPM, I am looking for ways to make it work and integrate it into my application. Here is what my structure looks like: https://i.sstatic.net/RUhsA.png ...

AngularJS | Using ngAnimate to Display Form Validation Errors

My form errors are currently being displayed successfully using CSS and conditional classes, but I recently discovered ng-message and ng-animate. Would it be possible to use ng-message to contain the error messages? Also, I have been unable to find any tu ...

What is the best way to incorporate a specific term from the class into CSS styling

I am working on a webpage that includes '<a> <i> <label>' elements with specific classes. <a class="icon-home"></a> <label class="icon-pencil"></label> <i class="icon-display"></i> I want to ...

Setting a Validator for a custom form control in Angular: A step-by-step guide

I need to apply validators to a specific control in formGroup from outside of a custom control component: <form [formGroup]="fg"> <custom-control formControlName="custom"> </custom-control> </form> this. ...

Adjusting the size of FontAwesome symbols using FitText

I recently started using FitText () to dynamically resize certain titles on my webpage. While I've had success with resizing h1, h2, and other text elements, I've run into an issue when trying to apply it to fontawesome icons. I know that FitText ...

Disabling the movement of arrows in the client-testimonials-carousel plugin

This plugin that I'm currently using is working flawlessly: However, I'm unsure about how to make the arrows stationary and prevent them from moving. Currently, they are centering themselves based on the height of the div, but I want them to rem ...