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
  • !38159

Fix selector for form floating background

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Mark Otto requested to merge cleanup-floating-forms into main Mar 02, 2023
  • Overview 5
  • Commits 1
  • Pipelines 0
  • Changes 1

This rewrites the selector to use :has() because .form-floating is a parent container, which has no :disabled state. The :disabled is handled on the individual form element.

That said, it'd be really cool if adding a disabled attribute on a parent element would disabled all the elements within—right now only fieldsets do that. And I genuinely just stumbled back into thinking about this... so what if we used fieldsets here in v6? Something to think about.

Anyway, the downside of using the :has() selector is browser compatibility right now. I'm not super worried about that as this could be seen as a progressive enhancement, but it's worth calling out. With the new selector, nothing is generated for disabled fields, so we avoid that problem entirely.

/cc @julien-deramond @louismaximepiton @jonnysp

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: cleanup-floating-forms