Issue with Firefox flexbox space-between causing item to overflow container

I encountered an issue with my simple component where items inside a flex container, specifically suffixes, are displayed outside the box in Firefox only. Even though I am using space-between in the flex item, the item extends beyond the boundaries of the flex container. Adding a height to the input element resolves the issue, but that's not the desired solution.

To demonstrate this problem, I have created a CodePen here since Sass can't be used in a Stack Snippet.

Has anyone else encountered this issue or knows of a workaround?

CodePen Link: https://codepen.io/ondrejko/pen/wvageWg

Answer №1

Utilizing two different types of input fields while utilizing the same CSS classes to achieve the desired styling (e.g., .Input.Input__field, .Input__suffix);

  1. One with a Prefix and Suffix containing an Icon (The input box should take up 75%, while the Icon occupies 25%).
  2. Input Modifiers. (By default: The input box should occupy 100%)

It is advisable to include a class (e.g., .default) to distinguish between input boxes with Icons and those without as mentioned above.

I have made modifications to the code on CodePen: https://codepen.io/mediraviteja/pen/OJyrozR

The changes I implemented are as follows:

a) Added the class ".default" to the container div (e.g., ) for all full-width inputs such as Default input, Modificator inputs)

b) Made CSS adjustments within the following classes

.Input__field{
    width: 100%; -- Remove CSS property
    max-width: 76%; -- Add CSS property
}

.Input__suffix{
    max-width: 26%; -- Add CSS property
}

**Added new class** 

.default .Input__field{
    max-width: 100%;    
}

.default .Input__suffix{
    max-width: 100%;  
}

Changed the HTML element

<div class="Input "> to <div class="Input default"> 

Whenever you require a full-width Input box like (Default input, Input -Warning, Input - Invalid boxes, etc.)

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

When an HTML table utilizes both rowspan and colspan attributes, it may encounter issues with being overlapped by the

I'm working on a straightforward table that showcases the properties of a data element. Each row will represent an element from the AJAX response in a list format. The table is designed with "rowspan" and "colspan" to expand specific cells. However, ...

Launch Bootstrap 4 Modal using JavaScript with just a simple click on a hyperlink

My goal is to trigger a modal to open when a link is clicked, but unfortunately I am unable to modify the HTML of the link itself. The only thing I can change is the href attribute. For example: <a href="#Modal">Open modal</a> I am not able ...

Dynamic Website Layout Bootstrap 4 [ card designs and Tabs ]

Currently, I am in the process of developing a web application that needs to be responsive across various devices including mobiles, tablets, and PCs. My focus right now is on creating a user profile page that adapts well to different screen sizes. To achi ...

What steps should I take to customize prettier for Vue.js template syntax?

I need to modify a specific feature in Prettier. I'm curious if there's a simple method to incorporate the solution below without creating a custom parser. My .prettierrc.js: module.exports = { $schema: 'https://json.schemastore.org/pret ...

What are the ways to integrate JSON data into Angular?

I am facing some issues with integrating JSON in Angular. Within my project, I am generating components and deleting the spec.ts files. Subsequently, I create a new file called prod.data.json { "products" : [ { ...

`Flex alignment of columns in Bootstrap 4`

I'm feeling really lost here. I had everything figured out, but after refreshing the jsfiddle, the solution suddenly changed on me. I have a row with two columns in it, but for some reason, I can't get them to align properly on the same row. I at ...

Several target elements on a single page

I am currently facing a problem with maintaining the active state of one anchor tag's target while clicking another button within the main identifier. Upon clicking the INTEL button, its opacity changes from 0 to 1. However, upon clicking Data Histor ...

The previously set display value remains unchanged when switching CSS files

I'm working on a project where I need to display three separate articles based on the screen size. Article 1 should only be visible when the screen width is less than 600 pixels Article 2 should be visible between 600 and 900 pixels Article 3 shoul ...

The CE button on the calculator seems to be malfunctioning

My calculator's CE button isn't working as expected – instead of deleting the last entered number, it clears all numbers. I want the CE button to only delete the last number entered. Additionally, I want the calculator to display a default valu ...

What is the process for sending a single post to two separate actions?

I am working with HTML and Javascript code to send a form using method=post to an action="www.randomaction.com/randomaction.php". My goal is to also send the form data to my email (the same post), but without opening the user's mail client. Instead, ...

Email Template not rendering properly across various platforms

Dealing with a frustrating issue here. I created a template using Foundation's E-mail features and it looks perfect in Chrome's Device mode as well as in MailChimp. However, when testing it in Litmus and sending it to my own email, things start t ...

What is causing the extra whitespace on the right side with container-fluid?

Could someone assist me with an issue I'm experiencing when using the container-fluid in Bootstrap? It seems to be leaving some space on the right side of my web page, and as a newcomer to Bootstrap, any help would be greatly appreciated. <link ...

When the page initially loads, the block appears on top of the upper block and remains in place after the page is refreshed

Upon initial loading, the block appears on top of another block but remains fixed upon page refresh. The same issue occurs in the mobile version of the site and occasionally displays correctly. The website is built on WordPress and optimized using Page Spe ...

Encountering additional backslashes ("") in each slash within the JSON response received from Laravel AJAX

I have been working on my Laravel app and attempting to make an ajax call. However, I am encountering an issue where there is one extra slash being added, whether it's a backslash or a forward slash. Can someone please explain why this is happening an ...

Styling with CSS in Django templates

Having trouble with CSS in my Django template, My settings.py looks like this: BASE_DIR = os.path.abspath(os.path.dirname(__file__) + '/') STATIC_URL = BASE_DIR + '/static/' I have a folder called "static/css/home_css.css" in my path ...

HTML/CSS: Issue with image grid layout where images of different heights are not wrapping correctly

I have a Wordpress-based web project in progress at the following link: The current setup of the post thumbnails grid on the website was done with the assumption that all thumbnails will be the same height. However, I am looking to modify it so that the t ...

Changing the Size of X-Axis Labels Font in a Line Chart Using ChartJS

Struggling with adjusting the font size of x-axis labels in my line chart design using ChartJS. I've attempted to set the x-axis ticks to my desired size, but the font size remains unchanged: options:{ scales:{ xAxis: [{ ...

What is the best way to remove headers and footers programmatically in print pages on Safari using JavaScript?

Struggling with eliminating the header and footer on print pages in Safari using JavaScript? While disabling the header and footer manually can be done through print settings in most browsers, my aim is to automate this process with code to ensure that use ...

Having trouble accessing the link from the dropdown list in Selenium

While trying to select a link from a dropdown menu, I am facing an issue with Selenium. The element is being located successfully, but it cannot be interacted with and the following exception is thrown: Error in thread "main" org.openqa.selenium.ElementNo ...

The OnSelectedIndexChange event seems to be failing to trigger

I've been struggling to get an event to execute properly. Adding AutoPostBack = "true" didn't fix the issue, and trying the same event on a different DropDownList was unsuccessful. <div class="col-sm-3" style="float: left"> ...