PikoPong
  • Web Dev
  • Hack
  • Database
  • Big Data
  • AWS
  • Linux
No Result
View All Result
PikoPong
  • Web Dev
  • Hack
  • Database
  • Big Data
  • AWS
  • Linux
No Result
View All Result
PikoPong
No Result
View All Result
Home Web Dev

Bruce Lawson’s personal site  : Don’t put pointer-events: none on form labels

February 12, 2021
in Web Dev
277 15
Bruce Lawson’s personal site  : Don’t put pointer-events: none on form labels


Don’t put pointer-events: none on form labels


Tuesday 9 February 2021

The other day I was tearing my hair out wondering why an HTML form I was debugging wouldn’t focus on the form field when I was tapping on the associated label. The HTML was fine:


<label for="squonk">What's your name, ugly?</label>
<input id="squonk">

I asked my good chum Pat “Pattypoo” Lauke for help, and without even looking at the form or the code, he asked “Does it turn off pointer events in the CSS?”

second time i’ve seen this recently, so to save others a lengthy bug-hunt: if you have a properly associated <label>, but clicking/tapping it doesn’t set focus to its correctly associated <input>/form element… check if for some reason the <label> has pointer-events:none in CSS

— patrick h. lauke #toryScum #clapForFlagWankers (@patrick_h_lauke) February 5, 2021

Lo and FFS, there it was! label {pointer-events:none;}! This daft bit of CSS breaks the browser default behaviour of an associated label, and makes the hit target smaller than it would otherwise be. Try clicking in the “What’s your name, ugly?” text:

Try me, I’m good


Try me, I’m crap


I’m jolly lucky to have the editor of the Pointer Events spec as my chum. But why would anyone ever do this? (That line of CSS, I mean, not edit a W3C spec; you do the editing for the sex and the glory.)

Once again, Pat whipped out his code ouija board:

aha, now i remember when i first saw a few weeks ago – testing something based on material design for web https://t.co/YkEKXkU0To pic.twitter.com/31S74X1i4R

— patrick h. lauke #toryScum #clapForFlagWankers (@patrick_h_lauke) February 5, 2021

And, yes—the presentation had originally been Material Design floating labels, and this line of CSS had been cargo-culted into the new design. So don’t disable pointer events on forms—and, while you’re at it, Stop using Material Design text fields!

Posted in
accessibility web standards, NOLIDGE BOMS, usability atrocities .
Follow comments via
RSS feed. Comment.

Leave a Reply





Source link

Share219Tweet137Share55Pin49

Related Posts

Weekly Platform News: Reduced Motion, CORS, WhiteHouse.gov, popups, and 100vw
Web Dev

Weekly Platform News: Reduced Motion, CORS, WhiteHouse.gov, popups, and 100vw

In this week’s roundup, we highlight a proposal for a new <popup> element, check the use of prefers-reduced-motion on...

February 26, 2021
The Things I Add to Tailwind CSS Right Out of the Box
Web Dev

The Things I Add to Tailwind CSS Right Out of the Box

In every project where I use Tailwind CSS, I end up adding something to it. Some of these things...

February 26, 2021
Laravel Sail adds support for choosing which services you’d like installed
Web Dev

Laravel Sail adds support for choosing which services you’d like installed

Laravel Sail, a lightweight CLI for interacting with Laravel's default docker environment, recently launched a new update that allows...

February 26, 2021
Reader Question: Why did you choose Statamic for Laravel News?
Web Dev

Reader Question: Why did you choose Statamic for Laravel News?

Steve McDougall asked us a great question on Twitter about our redesign and relaunch of Laravel News on Statamic:...

February 26, 2021
Next Post
Weekly Platform News: WebKit autofill, Using Cursor Pointer, Delaying Autoplay Videos

Weekly Platform News: WebKit autofill, Using Cursor Pointer, Delaying Autoplay Videos

Welcome to the new Laravel News

Welcome to the new Laravel News

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended

Is CSS float deprecated? | CSS-Tricks

Is CSS float deprecated? | CSS-Tricks

February 12, 2021

What Is RedwoodJS? — Smashing Magazine

September 22, 2020
Create A Responsive Dashboard With Angular Material And ng2-Charts — Smashing Magazine

Build And Deploy An Angular Form With Netlify Forms And Edge — Smashing Magazine

October 14, 2020
Deploy machine learning models to Amazon SageMaker using the ezsmdeploy Python package and a few lines of code : idk.dev

Deploy machine learning models to Amazon SageMaker using the ezsmdeploy Python package and a few lines of code : idk.dev

June 16, 2020

Categories

  • AWS
  • Big Data
  • Database
  • DevOps
  • IoT
  • Linux
  • Web Dev
No Result
View All Result
  • Web Dev
  • Hack
  • Database
  • Big Data
  • AWS
  • Linux

Welcome Back!

Login to your account below

Forgotten Password?

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In