Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #31472
Closed
Open
Issue created Aug 12, 2020 by Administrator@rootContributor

Inconsistent checkbox placement when a hidden element is between a legend and .form-check

Created by: tegandbiscuits

  • Operating system: macOS 10.15.6
  • Browser: Chrome 84.0.4147.105

In the alpha for 5.0.0 when a legend is followed by a hidden element (tested with .d-none and input[type="hidden"]) and div.form-check, then the checkbox will be on the same line as the legend but not the label, and also makes the checkbox not clickable (though it's possible to check by focusing on it). This seems to be the case with normal checkboxes and switches.

Example problematic markup:

<form>
  <fieldset>
    <legend>Unexpected</legend>

    <p class="d-none">Hello</p>
    <div class="form-check">
      <input class="form-check-input" type="checkbox" id="foo">
      <label class="form-check-label" for="foo">Foo</label>
    </div>
  </fieldset>
</form>

Produces this

Screen Shot 2020-08-12 at 3 34 40 PM

I would expect it to lay out like this (and also be clickable)

Screen Shot 2020-08-12 at 3 35 33 PM

Code Pen https://codepen.io/tegandbiscuits/pen/poygjPE

The current behavior is also not what happens with checkboxes in Bootstrap 4.

Also this seems to be able to be resolved by wrapping both the hidden element and .form-check in a div.

Assignee
Assign to
Time tracking