The popover box adjusts its width to fit the contents in Chrome, however, it does not do so in

Having issues with the container width in Edge compared to Chrome despite the Sass code working fine in Chrome. Here's the code:

.popover {
    font-family: 'Tahoma', sans-serif;
    max-width: 100%;
    box-shadow: 0 0 15px 6px #646262;

    hr {
        margin-top: 7px;
        margin-bottom: 7px;
    }

    .popover-header {
        font-size: 13px;
        background-color: $purple;
        color: white;
        text-align: center;
        font-weight: bold;

        &::before {
            border-bottom: none;
        }
    }

    .popover-body {
        .btn-group {
            min-width: 100%;
        }

        button {
            font-size: 11px;
            background-color: #d9d9d9;
            color: #000;
            font-weight: bold;
        }
    }
}

Chrome:

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

Edge:

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

Any suggestions on what might be causing this difference? Thank you!


EDIT:

There might be a connection to the 'w-100' class from Bootstrap, here's a snippet of the React component:

return (
    <th 
        id={k} 
        onClick={
            Number.isInteger(v) ||
            v == 62.5 ||
            v == "Mean" 
                ? 
                this.toggle
                :
                    null
        }
    >
        {Number.isInteger(v) || v == 62.5 ? v + 'th' : v} 
        {v == 'n' ? null : <i className='fas fa-sort'></i>}
        <Popover 
            placement='bottom' 
            isOpen={popoverOpen} 
            target={k} 
            toggle={this.toggle}
        >
            <PopoverHeader>Select New Percentile</PopoverHeader>
            <PopoverBody>
                <Row>
                    <Col>
                        <ButtonGroup size='sm'>
                            {
                                _.map(opt, o => {
                                    if (o < 50) {
                                        return (
                                            <Button 
                                                key={o}
                                                value={o}
                                                id={k}
                                                className='w-100' 
                                                onClick={this.props.handleClick}
                                            >
                                                { o + 'th' }
                                            </Button>
                                        )                                            
                                    }

                                })
                            }
                        </ButtonGroup>
                    </Col>
                </Row>
                <hr />
                <Row>
                    <Col>
                        <ButtonGroup size='sm'>
                            {
                                _.map(opt, o => {
                                    if (o == 50 || o == 'Mean') {
                                        return (
                                            <Button 
                                                key={o}
                                                value={o}
                                                id={k}
                                                className='w-100' 
                                                onClick={this.props.handleClick}
                                            >
                                                {Number.isInteger(o) ? o + 'th' : o}
                                            </Button>
                                        )                                            
                                    }

                                })
                            }
                        </ButtonGroup>
                    </Col>
                </Row>
                <hr />
                <Row>
                    <Col>
                        <ButtonGroup size='sm'>
                            {
                                _.map(opt, o => {
                                    if (o > 50) {
                                        return (
                                            <Button 
                                                key={o}
                                                value={o}
                                                id={k}
                                                className='w-100' 
                                                onClick={this.props.handleClick}
                                            >
                                                {o + 'th'}
                                            </Button>
                                        )                                            
                                    }

                                })
                            }
                        </ButtonGroup>
                    </Col>
                </Row>
            </PopoverBody>
        </Popover>
    </th>
);

Answer №1

Although it's not a perfect fix, I ended up manually setting the .popover {min-width: 432px;} to make it fit in Edge. It's effective in this specific scenario since I didn't require it to be smaller than 432px. However, in situations where flexibility is key, this hardcoded solution would not be suitable.

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

The popup is unable to remain in the center of the screen because the background page keeps scrolling back to the top

Whenever I click a button to open a popup window, the page unexpectedly scrolls to the top. It's frustrating because if I'm at the bottom of the page and press the 'submit' button, the popup doesn't display in the center as intende ...

Increase the size of the grid system column upon clicking on a Bootstrap icon

I am using Google Maps in a tab with Bootstrap, but the map is too small. I would like to change the Bootstrap grid system when I click on a FontAwesome icon: the first column should turn into col-md-8, and the second column should become col-md-4. Here i ...

Move the aircraft across the display in a lively animation

I need help creating an animation where a plane flies across the screen, exits from the left side, and re-enters from the right side in a continuous loop. How can I achieve this effect to make the plane fly endlessly across the screen? Here is my code: ...

The width specified for the table is not being applied

I've been struggling to adjust the width of my table in order to display data from a database. I've tried using inline width, !important tag, id, and class but none have worked. Interestingly, when I apply a fixed width without dynamic data, it w ...

Adjust the positioning of the .btn-group to display on a separate line when the screen reaches specific

After experimenting with Bootstrap 4 (alpha 6), I am impressed with its features. However, one challenge I encountered was creating a btn-group with checkbox/radios that would shift to the next line when it becomes too wide for the page. Here is an example ...

What is the process for reinserting a list item into the nested elements?

Looking for help with manipulating a menu in HTML? I have a menu that I want to modify by removing and adding list items. While I've had success removing items, I'm struggling to properly use the add method. Here's an example of what my menu ...

Utilizing React to invoke the filter method on Object.keys

A specific React component receives a state property that consists of nested objects: { things: { 1: { name: 'fridge', attributes: [] }, 2: { name: 'ashtray', ...

How can you customize the appearance of the Input component that wraps the Select in Material UI for React?

Here is an example of my JSX code: <FormControl> <InputLabel>My label</InputLabel> <Select> ... </Select> </FormControl> When using the classes prop to style elements within the FormControl and Select, I enco ...

Implement pagination for API calls within a React Component

I am trying to implement pagination for the results of an API call. The following code snippet shows how I am making the API call using Axios: apiCall() { const API = `http://www.omdbapi.com/`; axios.get(API, { params: { apikey: proces ...

What is the best way to showcase my subscription form on a web browser?

I am encountering an issue with my code. My goal is to generate a subscribe form modal. Although I have incorporated the subscribe form in my HTML document, upon running the code in the browser, the subscribe section is not visible. Can anyone offer assist ...

After the form submission, my Next.js component keeps rendering repeatedly in a cumulative manner

I am currently working on a memory game application using Next.js, Node.js, and Express.js. I seem to be encountering an issue specifically with the login page. Initially, there are no issues when submitting the form for the first time. However, after the ...

Issue with displaying strings in the value attribute of a function

When I call onClick on a Material-UI MenuItem and set the value attribute as a string, the event function interprets the value as zero. If I add a value="sometext" to other elements like a button, it works perfectly. Even though I am new to this, it seems ...

What is the best way to display the name of the user who has logged in using Facebook login?

After successfully implementing Facebook login using Passport.js, I encountered a problem with displaying the user's name in my React component. Despite correctly storing the id and name in the database on the backend, I struggled to retrieve and disp ...

Increase the background image size for a <li> element

I am working with an unordered list and have set it up to display a background image on the li element when the cursor hovers over it: <div class="sidebar"> <ul> <li>test</li> <li>test</li> ...

Effortless navigation through the document in both directions with seamless scrolling

To achieve a specific scrolling behavior on my webpage, I implemented the following function. Here is the code snippet: $(window).scroll(function(){ if ($(this).scrollTop() > 100) { $("html, body").animate({scrollTop: 700}, 500); re ...

Utilizing CSS in Angular to Conceal Background Images in the Project

CSS and HTML. Encountering an issue with the structure of my Angular project in the home.component.html file: <div id="homecontent"> <div class="imageslide"> <ng-image-slider [images]="imageObject" [imageSize]="{width: &apo ...

Is there a way for me to access the source code of elements within React Native?

Currently, I am working on writing code using React Native and compiling it in Android Studio with an emulator. When I press ctrl+m on the emulator and select "show inspector" to click on elements, I am unable to see which line of code corresponds to the s ...

Updating div width in Laravel blade using expressions or jQuery can be a simple task

Is there a way to dynamically change the width value of a div element based on a variable? The div contains blocks, and the size of each block is determined by the variable. For example, if $t->spotdiff = 2, I would like two equal blocks in a column wit ...

Error: The module cannot be found because the package path "./v4" is not being exported from the package

While working on a React project, I encountered an issue when attempting to run it. The error message displayed was: Module not found: Error: Package path ./v4 is not exported from package ....\node_modules\uuid (see exports field in ....\n ...

Having trouble with the npx create-next-app command? Encounter the ENOENT error message?

When attempting to run the command, I encountered an error that is insisting on using yarn even though I am using npx. Npx works perfectly fine for other projects, such as react apps. I expect it to give me the next application starter in line. ...