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
  • Merge requests
  • !12794

Fix UAs required message position on grouped radio buttons

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/epidemian/required-radio-button-groups into master Feb 19, 2014
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: epidemian

This PR fixes the positioning of the required error message shown by user agents when using the required attribute on radio inputs inside a btn-group button group.

JSFiddle example showcasing the problem. On Firefox the required message is rendered in bizarre places:

firefox-bad

And on Chrome the message is not shown. An error is logged to the console instead: "An invalid form control with name='options' is not focusable."

JSFiddle example with fix. On firefox:

firefox-good

And on Chrome:

chrome

The fix/hack is basically, instead of not rendering the element at all with display:none, using opacity:0, position:absolute and z-index:-1 so the radio input element has a defined position on the document and user agents can show the required message in the right place but at the same time it is invisible and doesn't affect the position of other elements.

Disclaimer: i only tested this in Firefox and Chrome on Ubuntu, and i don't know if those CSS properties are the best to "make an element have a position but be invisible" 😅

Cheers!

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/epidemian/required-radio-button-groups