Semantic-UI presents a trio of inline fields featuring a dropdown option

Looking to create three inline dropdowns that utilize all available space without stacking on mobile devices.

Here is the current RoR code being used:

<div class="three fields">

      <!-- birthdate day -->
      <div class="inline field">
        <%= select_day(nil, {prompt: 'Day', use_two_digit_numbers: true, field_name: 'birthdate_day', prefix: :user}, {class: 'ui fluid search dropdown'}) %>
      </div>

      <!-- birthdate month -->
      <div class="inline field">
        <%= select_month(nil, {prompt: 'Month', field_name: 'birthdate_month', prefix: :user}, {class: 'ui fluid search dropdown'}) %>
      </div>

      <!-- birthdate year -->
      <div class="inline field">
        <% min_year = Date.today.year - @sign_up_min_age %>
        <% max_year = Date.today.year - @sign_up_max_age %>
        <%= select_year(nil, {prompt: 'Year', start_year: min_year, end_year: max_year,
                        field_name: 'birthdate_year', prefix: :user}, {class: 'ui fluid search dropdown'}) %>
      </div>
    </div>

When using three fields, they take up all available space but stack on mobile. Changing to inline fields prevents stacking but does not fully occupy the space. A solution like three inline fields is desired.

After reviewing documentation and testing various combinations, no suitable solution has been found.

Thank you for your assistance.

Answer №1

How about using a uniform width grid layout instead of individual fields:

<div class="ui equal width grid">
  <div class="column">
    <!-- birthdate day -->
    <%= select_day(nil, {prompt: 'Day', use_two_digit_numbers: true, field_name: 'birthdate_day', prefix: :user}, {class: 'ui fluid search dropdown'}) %>
  </div>
  <div class="column">
    <!-- birthdate month -->
    <%= select_month(nil, {prompt: 'Month', field_name: 'birthdate_month', prefix: :user}, {class: 'ui fluid search dropdown'}) %>
  </div>
  <div class="column">
    <!-- birthdate year -->
    <% min_year = Date.today.year - @sign_up_min_age %>
    <% max_year = Date.today.year - @sign_up_max_age %>
    <%= select_year(nil, {prompt: 'Year', start_year: min_year, end_year: max_year, field_name: 'birthdate_year', prefix: :user}, {class: 'ui fluid search dropdown'}) %>
  </div>
</div>

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

Flexbox not achieving equal height

Having trouble making flexbox work with Susy? Here's what I've tried so far. I've experimented with various solutions found here, but couldn't get it to work consistently across different screen sizes. The heights of text containers an ...

Bootstrap - labels with several words may split into separate lines

When I create a form with input fields and labels in an ASP.NET view, I notice that labels with multiple words break into separate lines at full scale. I would like to keep these labels on one line for better aesthetics. Here's an example: @using (Ht ...

What is the best way to position an image in the center of an Ionic 2 application?

Hey there, I've got a few pages in my Ionic 2 app that contain an <ion-img> inside an <ion-content padding> like this: <ion-content padding> <p>Some text here....</p> <p>Some other text here...</p> < ...

Creating Dynamic Height for Div Based on Another Element's Height Using ReactJS and CSS

I'm attempting to set a fixed height for a div in order to enable overflow scrolling. However, I am encountering issues as I am using JavaScript within a useEffect hook to accomplish this task. The problem is inconsistent as sometimes the height is se ...

There seems to be a syntax error in the script where an expression was expected but

I have attempted numerous times to solve this issue but have been unsuccessful. Here is the code I have tried: <?php while($crow = mysqli_fetch_assoc($cres)) { echo ' <div class="item" onc ...

What is the best way to modify React state?

Can someone help me troubleshoot an issue with toggling React state after a button click? I want to be able to change "Work From Office" to "Work From Home" and vice versa, but it's only working once. Is there a way to achieve this using an if stateme ...

Generating a unique JavaScript array by extracting data from an HTML input element

I am working on a basic HTML form that requests a number between 1 and 10 from the user. Depending on this number, I aim to generate a new array. Currently, the code displays an alert box with the newly created array, but my end goal is to have a table p ...

Please refrain from altering the color of my flag on hover

I am working with a table that has rows marked with flags. Below is the CSS I have used: <table class="hovered no-border" data-url="@Url.Action("General", "Transport")"> <tbody> <tr> <td><input type="che ...

Replacing an array element in React.js

Here is a React.js code snippet where I am trying to utilize an array called distances from the file Constants.js in my Main.js file. Specifically, I want to replace the APT column in the sampleData with a suitable value from the array distances extracted ...

Check that EACH radio button has been either selected or left unselected when the button is clicked

I'm still learning Javascript and currently working on a function triggered by a button click. My goal is to display an alert if NONE of the radio buttons have been selected, regardless of whether they are "Yes" or "No." If ALL radio buttons have been ...

The image hover effect seems to be malfunctioning

Within my "profile.php" file, I have included a separate "head.php" file that features two images and three labels (two of which contain an additional image). .parent { position: relative; top: 0; left: 0; } .image1 { position: relative; top: ...

CSS: The Ultimate Guide to Concealing the Second Row in a Table

I have a single table in my code: <table> <tr><td>sample data 1</td></tr> <tr><td>sample data 2</td></tr> <tr><td>sample data 3</td></tr> <tr><td>sample data 4</t ...

The Twitter widget is not staying in sync with the rest of the page when scrolling on

Twitter provides a widget that is widely used by many people. Below is the code provided by Twitter: <script src="http://widgets.twimg.com/j/2/widget.js"></script> <script> new TWTR.Widget({ version: 2, type: 'profile', ...

Unable to register Handlebars helper that is missing

Handlebars helper missing registration issue The following code displays the condition block on the page: <table class="table table-striped sorting"> <thead> <tr class="home"> <th>Title& ...

Transforming the mui stepper connection into a progress bar is simple. Each step contains individualized content to guide you through the process

Is there a way to make the MUI stepper connector act as a progress indicator? I have step content and connectors as separate divs, but I'm having trouble styling them. Any assistance would be greatly appreciated! ...

What is the process for importing a JSON file into an HTML table?

I have been struggling to pull data from a JSON file into an HTML table. Despite following various posts and tutorials, nothing seems to work. I am unsure if the functions are incorrect or if I am not implementing them correctly. Here is the content of my ...

The script is not functioning properly when placed outside of the HTML body tag

I have a main template that is functioning properly with the layout I've included here. However, I am facing an issue when trying to organize the scripts within one block. Specifically, when I move one of the scripts from the body section to the head ...

The background is obscured from view because of its current positioning

The issue I am facing is that the background color of the <ol> list is not showing correctly. This problem arose after I floated the label to the left and the input to the right. How can I resolve this? The desired outcome should be: My current resu ...

Centering an image that is absolutely positioned within a container that is relatively positioned, horizontally

Looking to center an image that is positioned absolutely horizontally within a container that is relatively positioned. After attempting with CSS and not finding success, I ended up using Jquery. http://jsfiddle.net/CY6TP/ [This is my attempt using Jquery ...

Numerals are warping inside the realm of Divination

When the numbers in my div reach more than 100 thousand, they start squeezing together like 11295551.25 <div class="col-2 text-right pr-0 "><%# Eval("CreditLimit", "{0:c}").ToString().Replace(".", ".&l ...