What modifications were implemented in Bootstrap 5 to cause controls to automatically assume their maximum size?

After upgrading NodeJs to version 16.13.0 from 14.x, one of the modules that was updated was bootstrap. This caused me to remove my Jumbotron control due to the upgrade, although I don't believe that is directly related to the issue I am experiencing. Following the upgrade, I noticed that the 'row' class on several <div> elements is being ignored, resulting in all other controls appearing on separate lines with a maximum width matching the container width.

https://i.sstatic.net/XZ13t.png

For example, as shown in the image, my Totals component displays Subtotal with the value below it on a new line. Here is the code for my Totals component:

import React from 'react';
import { GetTotal } from './CartHandler';
import { formatter } from '../common.js'

import "./Checkout.scss"


export default function TotalsBlock(props) {
    let carttotal = GetTotal();
    let shipping = 10.57;
    let taxes = 4.93;


    return (
        <aside id="checkout" className="block col-1">
            <h1>Total</h1>
            <div className="row">
                <label>Subtotal</label>
                <label>{formatter.format(carttotal)}</label>
            </div>
            <div className="row">
                <label>Shipping</label>
                <label>{formatter.format(shipping)}</label>
            </div>
            <div className="row">
                <label>Taxes</label>
                <label>{formatter.format(taxes)}</label>
            </div>
            <hr/>
            <div className="row">
                <label>Total</label>
                <label>{formatter.format(carttotal + shipping + taxes)}</label>
            </div>
        </aside>
    );
}

... and here is the content of Checkout.scss:

#checkout {
    .row {
        display: flex;
        align-items: stretch;
        justify-content: space-between;
        margin-right: 0;
        margin-left: 0;
        font-size: 12px;
    }

    h1 {
        font-size: 1rem;
        font-weight: bold;
    }

    .col-1 {
        flex: 1;
        max-width: 33%;
    }

    .col-2 {
        flex: 2;
        max-width: 66%;
    }

    .header {
        background-color: cornflowerblue;        
        color: white;
    }

    .block {
        background-color: lightgray;
        padding: 1rem;
        margin: 0.5rem;
        border-radius: 0.5rem;
    }

    .table-wrapper {
        max-height: 200px;
        overflow: auto;
    }

    th.price, th.quantity {
        width: 10%;
    }

    .table-extra {
    }
}

I'm curious about the changes in bootstrap 5 that may have caused the 'row' class not to work properly, ultimately resulting in my elements reaching their maximum size. I suspect these issues are intertwined. Any assistance would be greatly appreciated.

UPDATE

https://i.sstatic.net/wYh1g.png

Upon inspecting with the Browser's DevTools, I observed that the width of the .row class is set to 100%. Manually unchecking or setting the width to auto corrects the layout. However, adding width: auto to .row in the Checkout.scss file still results in the width being set to 100%...

Answer №1

Maybe not the most optimal approach...

I made the following adjustment:

.row > * {
    width: auto;
}

...in the Checkout.scss file to override bootstrap. I am open to any suggestions for a more effective solution.

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

Typescript - Conditional imports

When working with the moment-timezone module, one issue that arises is receiving a warning if it is included multiple times. In my specific case, I have a module that necessitates the use of this timezone functionality. Since I am unsure whether or not the ...

What are the typical steps for updating node_modules (specifically using `npm install` or `npm update`) after changing git branches in a project?

Is it a common practice to switch git branches frequently, and if so, should we then use npm update instead of npm install because npm update may be more than enough? (and isn't update much quicker than install)? (Switching branches could involve ...

Controlling Node.js application with Electron app: initiating and terminating

I'm currently working on the functionality to control the start and stop of another node.js application within my electron app. So far, I've managed to successfully start the node application from bot.js by running npm start to launch the electr ...

Efficiently processing multiple Ajax requests with a single callback function

I am currently facing a situation where I need to make multiple AJAX requests and only proceed if all of them are successful. The typical usage of $.when($.ajax(), [...]).then(function(results){},[...]); doesn't quite fit my needs because the number o ...

Using default value in PHP and JavaScript for a select dropdown

I have an array of cities stored in associative arrays using PHP. I am utilizing JavaScript's "on change" event to capture the value of each item. In the future, I am considering implementing geolocation for setting a default item. Here are my arrays ...

What is the trick to have a CSS element overflow the boundaries of its containing div entirely?

Currently, I have a JS Fiddle project where I am attempting to achieve a specific effect. In the project, there is a circle positioned at the center of a div. When the script runs, the circle expands evenly in all directions until it reaches the borders on ...

Encountering an issue with postman where properties of undefined cannot be read

I am facing an issue while trying to create a user in my database through the signup process. When I manually enter the data in the create method, it works fine as shown below: Note: The schema components are {userName:String , number:String , email:Stri ...

A new thrower has been created, causing an unhandled 'error' event

Today I encountered a peculiar issue while using Visual Studio Code for Angular applications, something that has never happened to me before! Upon attempting to create a new project with the command 'ng new projects-name', I was faced with an er ...

Methods for scaling the size of CSS background images

Can anyone assist me with scaling background image size properly? code: http://codepen.io/AnilSimon123/pen/JRBRZa Below is the code snippet: .bgimage{ background:url('http://www.thedesignlove.com/wp-content/uploads/2012/08/free-blue-abstract-vec ...

Is there a way to activate a function in a sibling component without using Prop Drilling?

Looking at the image, you can see the structure of components I have. <Invoice> <Left></Left> <Right></Right> </Invoice> In the Left component, there is a form, and in the Right component, there is a Submit button l ...

How can one implement this python code snippet in node.js?

How can I execute this in Node.js? vCmd = any command that requires root privileges vPwd = "1234" #inputted earlier in a different dialog vProc = subprocess.Popen(["sudo", "-S", "xfce4-terminal", "-e", vCmd], stdin=subprocess.PIPE, stderr=subprocess.PIPE) ...

The dictionary of parameters includes an empty value for the parameter 'imageWidth', which is of a non-nullable type 'System.Int32'

I am facing an issue with a function that executes an ajax call to an ActionResult. It sends a base64 string of an uploaded image along with some additional parameters containing information about the dimensions of the image. The data is sent to the server ...

Revise the text while keeping the column content unchanged

Is it possible to change the text in a column without affecting the image using Jquery? Can this be achieved solely with Jquery without any modifications to the HTML code? Check out the demo $(".jsNoWrap").text("Change text"); <script src="https://a ...

I am implementing a new method in the prototype string, but I am uncertain about its purpose

I am trying to wrap my head around the concept here. It seems like the phrase will pass a part of an array, in this case eve, to the phrase.palindrome method. This method will then process it. First, the var len takes the length of eve and subtracts 1 from ...

Tips for correctly deleting a duplicate ref Object ID following the removal of a Document

Coming from a background in relational databases, I'm encountering a challenge with a pattern in Mongoose. Let's say we have SchemaA and SchemaB (for example, pets and people): const Person = new Schema({ name: String, pets: [{ ref: ...

What is the method for changing the color of the bottom border from blue to green in a select field with React JS?

I am currently utilizing the select field component from material UI react Upon selecting an item from the field, I encounter two specific issues: The border bottom line turns blue and the background color changes to gray. My objective is to modify the ...

Troubleshooting problems with displaying views due to asynchronous $http.get calls in AngularJS

Within my application, I am utilizing two separate API calls. The initial call retrieves a catalog of services along with their unique ID's. Subsequently, once the ID information is acquired, a second call is made to retrieve pricing data for each cor ...

React JS state that points to another state value

I am trying to create a component that displays a list of products along with individual list items for each product. However, I keep encountering the following error: TypeError: Cannot read property 'products' of undefined new ProductList src/c ...

AngularJS enables tab highlighting by responding to button selections

In my application, there are 3 tabs set up as follows: <li ng-class="{ active: isActive('#one')}"><a data-toggle="tab" class="tab-txt-color" href="#one" ng-click="selectTab('fruits') ...

React - Customizable Counter Components - Control All Counters with Parent Component

Hello everyone, I'm fairly new to React and still in the learning process. Currently, I have a challenge that involves creating a simple React Counter app with some specific requirements. The challenge is to build the app without using Redux or hooks. ...