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

Custom file focus styling for firefox keyboard users

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/tmorehouse/add-js-helpers into add-js-helpers Nov 15, 2017
  • Overview 0
  • Commits 4
  • Pipelines 0
  • Changes 2

Created by: tmorehouse

Firefox does not correctly work with the input[type="file"]:focus ~ .custom-file-control sibling selector, as it considers the browse button inside the file input to have focus and not the actual input[type="file"), when either clicking the browse button or tabbing into the input.

See the answer for question https://stackoverflow.com/questions/20095105/input-type-file-focus-adjacent-selector-in-css (its an old question from 2015, but it is still applicable).

Proposed solution: The <label> wrapper does make focus styling work for mouse users, but does not work for keyboard users (the inner browse button of the file input gets focus, not the actual file input when tabbing into the file input).

Adding a focusin/focusout handler (in helpers.js) that adds/removes the class .focus, and adding the class selector in _custom-forms.scss addresses this issue.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/tmorehouse/add-js-helpers