0

Problem

I'm having a problem with flex boxes. It is wrapping the content like it should, however any items that overflow the parent container are truncated. See the image below:

enter image description here

Here's the HTML of the entire page:

    <html lang="enUS">
        <head>
            <!-- Page Title (Shows up in title bar of browser) -->
            <title>Test Page: User Drill Down</title>
            <!-- Favirotie Icons (Shows up next to the URL in the browser address bar)
                 Generated from https://realfavicongenerator.net/ -->
            <link rel="apple-touch-icon" sizes="180x180" href="http://localhost:22080/core/images/favicons/apple-touch-icon.png">
            <link rel="icon" type="image/png" sizes="32x32" href="http://localhost:22080/core/images/favicons/favicon-32x32.png">
            <link rel="icon" type="image/png" sizes="16x16" href="http://localhost:22080/core/images/favicons/favicon-16x16.png">
            <link rel="manifest" href="http://localhost:22080/core/images/favicons/site.webmanifest">
            <link rel="mask-icon" href="http://localhost:22080/core/images/favicons/safari-pinned-tab.svg" color="#5bbad5">
            <link rel="shortcut icon" href="http://localhost:22080/core/images/favicons/favicon.ico">
            <meta name="msapplication-TileColor" content="#da532c">
            <meta name="msapplication-config" content="http://localhost:22080/core/images/favicons/browserconfig.xml">
            <meta name="theme-color" content="#ffffff">
            <!-- JavaScript Core Files -->
            <script type="text/javascript" src="http://localhost:22080/core/js/baseline/ajax.js"></script>
            <script type="text/javascript" src="http://localhost:22080/core/js/baseline/heartbeat.js"></script>
            <script type="text/javascript" src="http://localhost:22080/core/js/baseline/treewalker.js"></script>
            <script type="text/javascript" src="http://localhost:22080/core/js/baseline/verify.js"></script>
            <!-- Install Bootstrap CSS -->
            <link rel="stylesheet" type="text/css" href="http://localhost:22080/APIs/bootstrap/bootstrap-3.3.7-dist/css/bootstrap.css">
            <!-- Install FontAwsome CSS -->
            <link rel="stylesheet" type="text/css" href="http://localhost:22080/APIs/fontawsome/fontawesome-free-5.15.1-web/css/all.min.css">
            <!-- Install Custom Common CSS -->
            <link rel="stylesheet" type="text/css" href="http://localhost:22080/core/css/common.css">
            <!-- Install Custom Header CSS -->
            <link rel="stylesheet" type="text/css" href="http://localhost:22080/core/css/header.css">
            <!-- Install Slider CSS -->
            <link rel="stylesheet" type="text/css" href="http://localhost:22080/core/css/toggle.css"> 
            <!-- Install Bootstrap Datepicker -->
            <link rel="stylesheet" type="text/css" href="http://localhost:22080/APIs/datepicker/css/bootstrap-datepicker3.min.css">
            <style type="text/css">.table-hover > tbody > tr:hover
    {
        color: #FFFFFF;
        background-color: #000000;
    }
    .table-striped > tbody > tr:nth-of-type(odd)
    {
        background-color: #000033;
    }
    .table > thead > tr > th,.table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td
    {
        border-top-color: #660000;
    }
    .table > thead > tr > th
    {
        border-bottom-color: #660000;
    }
    table-bordered
    {
        border-color: #660000;
    }
    .table-bordered > thead > tr > th,.table-bordered > tbody > tr > th,.table-bordered > tfoot > tr > th,.table-bordered > thead > tr > td,.table-bordered > tbody > tr > td,.table-bordered > tfoot > tr > td
    {
        border-color: #660000;
    }
    .table-bordered th,.table-bordered tdborder-color
    {
        #660000: undefined;
    }
    .slider
    {
        background-color: #000033;
    }
    .slider:before
    {
        background-color: #808080;
    }
    input:checked:disabled + .slider
    {
        background-color: #FFFFFF;
    }
    input:disabled + .slider
    {
        background-color: #FFFFFF;
    }
    input:checked + .slider
    {
        background-color: #9999FF;
    }
    input:focus + .slider
    {
        box-shadow-color: #9999FF;
    }
    .cb-std:before
    {
        color: #99FF99;
    }
    .cb-std:checked:before
    {
        color: #99FF99;
    }
    .rb-std:before
    {
        color: #99FF99;
    }
    .rb-std:checked:before
    {
        color: #99FF99;
    }
    legend
    {
        border-bottom-color: #FF9999;
    }
    tooltip
    {
        color: #FFFFFF;
        background-color: #000000;
    }
    tooltip-inner
    {
        color: #FFFFFF;
        background-color: #000000;
    }
            </style>
        </head>
        <body href-link="drilldown.php" session-timeout="600" popup-time="30" style="color: rgb(0, 0, 0); text-decoration-color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
            <!-- Timeout Modal Dialog -->
            <div class="container">
                <!-- Modal -->
                <div class="modal fade" id="logoutDialogBox" role="dialog" style="color: rgb(0, 0, 0); text-decoration-color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
                    <div class="modal-dialog">
                        <!-- Modal content-->
                        <div class="modal-content">
                            <div class="modal-header" id="logoutHead">
                                <h4 class="modal-title">Login Session Expired</h4>
                            </div>
                            <div class="modal-body" id="logoutBody">
                                <p>You have been inactive for some time. Your session will expire 
                                in <span id="logoutTime"></span> seconds. Click on 
                                the Stay Logged In button to stay logged in, or to logout now, click 
                                the Logout button.</p>
                            </div>
                            <div class="modal-footer" id="logoutFoot">
                                <button type="button" class="btn btn-default" id="buttonStayLoggedIn">Stay Logged In</button>
                                <button type="button" class="btn btn-default" id="buttonLogout">Logout</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- Beginning of header Nav Bar -->
            <div id="navigationBarHeader">
                <!-- Navbar header with logo, time, and logout button -->
                <nav id="navigationBar" class="navbar navbar-default">
                    <div class="container-fluid">
                        <div class="navbar-header">
                            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                                <span class="sr-only">Toggle navigation</span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                            </button>
                            <!-- Sea-Core Logo Image -->
                            <img class="navbar-brand" alt="Brand" src="http://localhost:22080/core/images/branding/base_small.png">
                            <!-- Div for the time -->
                            <div class="navbar-text" id="timeday">9:29:11 PM</div>
                        </div>
                        <!-- Collect the nav links, forms, and other content for toggling -->
                        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                            <!-- Nav Bar, Left Side -->
                            <ul class="nav navbar-nav">
                                <button type="button" id="returnHome" class="btn btn-default navbar-btn">Home</button>
                            </ul>
                            <!-- Nav Bar, Right Side -->
                            <ul class="nav navbar-nav navbar-right">
                                <li>
                                    <!-- All pages have the logout button -->
                                    <button type="button" id="logout" class="btn btn-default navbar-btn">Logout</button>
                                </li>
                            </ul>
                            <span class="icon-bar"> </span>
                        </div><!-- /.navbar-collapse -->
                    </div><!-- /.container-fluid -->
                </nav>
                <!-- End of header Nav Bar -->
                <!-- Beginning of function bar -->
                <nav id="functionBar1" class="nav nav-inline" hidden="">
                    <button type="button" id="something" class="btn btn-default navbar-btn">Item 1</button>
                    <button type="button" id="something" class="btn btn-default navbar-btn">Item 2</button>
                    <div class="btn-group" role="group" aria-label="...">
                        <button type="button" id="something" class="btn btn-default navbar-btn">Item 3.1</button>
                        <button type="button" id="something" class="btn btn-default navbar-btn">Item 3.2</button>
                    </div>
                    <div class="btn-group" role="group" aria-label="...">
                        <button type="button" id="something" class="btn btn-default navbar-btn">Item 4.1</button>
                        <button type="button" id="something" class="btn btn-default navbar-btn">Item 4.2</button>
                        <button type="button" id="something" class="btn btn-default navbar-btn">Item 4.3</button>
                        <button type="button" id="something" class="btn btn-default navbar-btn">Item 4.4</button>
                    </div>
                </nav>
                <!-- End of function bar -->
            </div>
            <!-- Start of main content area -->
            <div id="mainFrame">
                <div style="color: rgb(0, 0, 0); text-decoration-color: rgb(0, 0, 0);" id="errorTarget"></div>
                <div style="color: rgb(0, 0, 0); text-decoration-color: rgb(0, 0, 0);" id="responseTarget"></div>
                <div class="row row-list">
                    <div id="link-nav" class="col-xs-2 link-nav-div"></div>
                    <div id="main" class="col-xs-8 link-main-div">
<div>
    <div class="row" style="place-content: center; text-align: center;">
        <span style="font-size: 24px; font-weight: bold;">Drill Down Test Module</span>
        <span> </span>
    </div>
    <div class="row" style="place-content: center; text-align: center;">
        <span style="font-size: 24px; font-style: italic;">Users</span>
    </div>
</div>
<div class="image-border" style="left: 67px !important; width: 1211px !important; height: 6px !important; padding-bottom: 18px !important; padding-top: 12px !important;">
    <canvas width="1211" height="6"></canvas>
</div>
<form class="form-horizontal">
    <div class="row">
        <div class="container" id="ddlink" style="color: rgb(0, 0, 0); text-decoration-color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
            <div class="flex-box-row" id="xddlink2">
                <span class="text-control"> 0 </span>
                <span class="text-control"> 1 </span>
                <span class="text-control"> 2 </span>
                <span class="text-control"> 3 </span>
                <span class="text-control"> 4 </span>
                <span class="text-control"> 5 </span>
                <span class="text-control"> 6 </span>
                <span class="text-control"> 7 </span>
                <span class="text-control"> 8 </span>
                <span class="text-control"> 9 </span>
                <span class="text-control"> A </span>
                <span class="text-control"> B </span>
                <span class="text-control"> C </span>
                <span class="text-control"> D </span>
                <span class="text-control"> E </span>
                <span class="text-control"> F </span>
                <span class="text-control"> G </span>
                <span class="text-control"> H </span>
                <span class="text-control"> I </span>
                <span class="text-control"> J </span>
                <span class="text-control"> K </span>
                <span class="text-control"> L </span>
                <span class="text-control"> M </span>
                <span class="text-control"> N </span>
                <span class="text-control"> O </span>
                <span class="text-control"> P </span>
                <span class="text-control"> Q </span>
                <span class="text-control"> R </span>
                <span class="text-control"> S </span>
                <span class="text-control"> T </span>
                <span class="text-control"> U </span>
                <span class="text-control"> V </span>
                <span class="text-control"> W </span>
                <span class="text-control"> X </span>
                <span class="text-control"> Y </span>
                <span class="text-control"> Z </span>
            </div>
        </div>
    </div>
</form>
<div class="image-border" style="left: 168px !important; width: 1009px !important; height: 6px !important; padding-bottom: 18px !important; padding-top: 12px !important;">
    <canvas width="1009" height="6"></canvas>
</div>
<div class="row">
    <div class="container" id="dddata">
    </div>
</div>
<div class="image-border" style="left: 67px !important; width: 1211px !important; height: 6px !important; padding-bottom: 18px !important; padding-top: 12px !important;">
    <canvas width="1211" height="6"></canvas>
</div>
<div class="bottom-links">
    <div class="row">
        <div class="col-xs-2">
        </div>
        <div class="col-xs-2">
            <a onclick="window.open('http://localhost:22080/core/misc/privacy.php');">Privacy Policy</a>
        </div>
        <div class="col-xs-2">
            <a onclick="window.open('http://localhost:22080/core/misc/cookie.php');">Cookie Policy</a>
        </div>
        <div class="col-xs-2">
            <a onclick="window.open('http://localhost:22080/core/misc/about.php');">About Us</a>
        </div>
        <div class="col-xs-2">
            <a onclick="window.open('http://localhost:22080/core/misc/contact.php');">Contact Us</a>
        </div>
        <div class="col-xs-2">
        </div>
    </div>
</div>
<div class="vspace10"></div>
</div>
                    <div id="link-stat" class="col-xs-2 link-status-div"></div>
                </div>
            </div>
            <!-- End of main content area -->
    
        <div>
            <form id="token_form">
                <input type="hidden" name="token_data" id="token_data" value="144542ef22e58a893ce414ddbd3cdad9342037fe12194ad94003f6ac85471b53">
            </form>
        </div>      <!-- Install Timer -->
            <script type="text/javascript" src="http://localhost:22080/core/js/baseline/timer.js"></script>
            <!-- Install regular jQuery -->
            <script type="text/javascript" src="http://localhost:22080/APIs/jquery/BaseJQuery/jquery-3.3.1.min.js"></script>
            <!-- Install Bootstrap -->
            <script type="text/javascript" src="http://localhost:22080/APIs/bootstrap/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
            <!-- Install FontAwsome -->
            <script type="text/javascript" src="http://localhost:22080/APIs/fontawsome/fontawesome-free-5.15.1-web/js/fontawesome.min.js"></script>
            <!-- Install Logout Modal Handlers -->
            <script type="text/javascript" src="http://localhost:22080/core/js/baseline/modal.js"></script>
            <!-- Common Javascript -->
            <script type="text/javascript" src="http://localhost:22080/core/js/baseline/common.js"></script>
            <!-- Install Custom Checkbox -->
            <script src="http://localhost:22080/APIs/checkbox/dist/js/bootstrap-checkbox.js"></script>
            <!-- Install Datepicker -->
            <script src="http://localhost:22080/APIs/datepicker/js/bootstrap-datepicker.min.js"></script>
            <!-- Install Header Custom JavaScript -->
            <script type="text/javascript" src="http://localhost:22080/core/js/baseline/header.js"></script>
            <script type="text/javascript" src="http://localhost:22080/core/js/baseline/common.js"></script>
            <script type="text/javascript" src="http://localhost:22080/core/js/baseline/html.js"></script>
            <script type="text/javascript" src="http://localhost:22080/test/drilldown.js"></script>
            <!-- Checkbox Boot Script -->
            <script type="text/javascript">
                function featureCheckbox() {
                    $(':checkbox').checkboxpicker({
                        html: true,
                        offLabel: '<span class="glyphicon glyphicon-remove">',
                        onLabel: '<span class="glyphicon glyphicon-ok">'
                    });
                }
            </script>
            <!-- Tooltip Boot Script -->
            <script type="text/javascript">
                function featureTooltip() {
                    $('[data-toggle="tooltip"]').tooltip();
                }
            </script>
            <!-- Datepicker Boot Script -->
            <script type="text/javascript">
                function featureDatepicker() {
                    $('.datepicker').datepicker();
                }
            </script>
        </body>
    </html>

And here is the relevant CSS:

/* Flex boxes */
.flex-box-row {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: flex-start;
    overflow-wrap: break-word;
    overflow: hidden;
}

.flex-box-row>*{
    flex: 0 0 auto;
}

span.text-control {
    font-size: 14pt;
    font-weight: bold;
    cursor: pointer;
}

Here are some other screenshots that shows the results of other solutions that I have tried:

enter image description here

In this one, the zero is truncated from the beginning.

enter image description here

Here part of the beginning and ending text is cut off.

NOTE: overflow-wrap and overflow CSS attributes have no effect. I've tried it both ways.

NOTE: Since there are a series of SPAN elements as the flex child, I tried adding min-width: 0; as suggested by some of the linked questions but it does not work.

NOTE: This is related to another question here about partitioning large database tables into smaller pieces. That is located here: Splitting up large data sets into smaller pieces for web viewing Needless to say, I have solved that problem.

Basically, anything that is outside the parent container in those two boxes is not displayed (you can't even click on them), but then content displays normally on the next line. As shown in the image with the flexbox highlighted, it extends past the container. I need to constrain that.

Also Bootstrap 3 is being loaded, but is not being used for the flexbox.

Research

I have done a lot of research into this over the past two days and here's what I have found:

Prevent flex items from overflowing a container

Flexbox item multiline text overflow

Truncated text in nested flexbox items

Centering Items with Flexbox and Overflow

Flexbox items with block content overflow the flexbox container

https://codepen.io/ScottWhittaker/pen/apKqpK

https://css-tricks.com/flexbox-truncated-text/

And many more....

Things that I have tried

I have tried multiple solutions with varying results. However, the main issue of truncating the items is still there no matter what solution that I have tried.

EDIT: 06/05/2021 2230 PDT

As people have pointed out about mixing inline and stylesheets, I'm working on that right now. However, the big issue here is that SOME mixing between stylesheets and inline styles cannot be avoided. The primary reason are theme colors (kinda hard to have many themes with stylesheets) and computed sizes such as the image-border stuff. Also some of the font things with the title headers must also be specified inline because JSON from the server can specify it. Everything inside the DIV with id="main" is generated on the client with JavaScript that interprets JSON from the server. Everything else is a template page that's generated by PHP on the server. Furthermore, when I try to do a minimal code set to reproduce the problem, I can't. That tells me that it's a stylesheet causing the problem, but I'm not sure which one. Bootstrap 3 is being loaded and used throughout the page. I wonder if it's a Bootstrap problem or a problem with one of my stylesheets. I will continue to try to build a minimal example to reproduce the problem though. As for all the external links pointing to localhost, I'm working on that as well.

Daniel Rudy
  • 1,411
  • 12
  • 23
  • Where the relevant html ? It's best to put up a working code snippet illustrating the issue – Rainbow Jun 04 '21 at 20:14
  • @ZohirSalak It's in the big screen shot. I can't put it up as text because the HTML is fully dynamic and generated on the client side in response to JSON from the server. – Daniel Rudy Jun 04 '21 at 22:10
  • Dynamic or not it doesn't matter, You let it run once then copy the code from the dev tools, If you can't provide a code snippet that reproduces the issue i don't think anyone can help you – Rainbow Jun 04 '21 at 23:18
  • @ZohirSalak It took me awhile to figure it out, but I got it. The HTML for the entire page is now listed. – Daniel Rudy Jun 05 '21 at 04:49
  • All of your external links are pointing to localhost, It's not worth to just copy paste the whole page, rather try to limit the code yourself to only the problem – Rainbow Jun 05 '21 at 10:46
  • @ZohirSalak I posted an edit about that. Besides, turns out that the container class from Bootstrap-3 is screwing things up but I'm not sure why. Something about the CSS class changing properties based on the width. – Daniel Rudy Jun 06 '21 at 07:09
  • 1
    Yup, this is exactly the first step you should take before ever asking a question, try to limit the code as much as possible with the issue still rising, by doing that you ended up finding the problem and the solution, I can't tell you for sure as i don't have a working piece of your code that i can look at, Also mixing stylesheets shouldn't be a problem, The way css works totally ignores how the styles are added to the document. – Rainbow Jun 06 '21 at 12:21

2 Answers2

0

I would recommend first of all not to mix up inline styles and stylesheets so much - its very hard to tell whats the issue when there is so many inline styles in a large html document. (Also keep in mind any inline styles will take presedence over your classes in the external stylesheet)

Maybe you could supply a minimal reproduction of the error with only the bit of HTML and CSS that is relevant to the problem in a codepen or a jsfiddle? It would make it much easier to help you

  • I figured out the problem. The issue was the div with the container class. Not sure why it was messing everything up, but it's working now. Thank you for the input. I am going to close this question. – Daniel Rudy Jun 06 '21 at 07:13
0

After doing a considerable amount of research, testing, and debugging, I found the problem. It seems that bootstrap-3's container class was the culprit. Removing that class for the HTML hierarchy corrected the problem in all cases. With that in mind, I took a look at the class. It had different properties depending on the width of the window. Looking at the docs, it's part of the responsive page functionality which allows a page to be optimally viewed on different size devices.

It was also causing a problem with tables too. Rows would have missing columns. That has been corrected as well.

Thank you to everyone who responded.

Daniel Rudy
  • 1,411
  • 12
  • 23