A new explainer for a new HTML attribute to handle handwritten inputs. Like this:
<input type="text" handwriting="true" ... >
<input type="text" handwriting="false" ... >
<textarea handwriting="" ... > <!-- evaluates to "true" -->
<div contenteditable handwriting="true">...</div> <!-- maybe? -->
The primary use case is for those using one of those writing devices for touch screens, like Apple Pencil. The explainer comes from the Microsoft Edge team, so maybe the Surface Slim Pen is the impetus behind it. I suppose there are other use cases since the same devices that support pen-like input devices also tend to support using your finger. There are also those text box signatures in apps like DocuSign that are impossibly tough to sign with a mouse cursor, though it’s possible.
We’ll let the author, Adam Ettenberger, articulate it better than I can:
The developer authoring the drawing widget may not be aware that it may be on top of or near an input element, and it seems bad if they need to find such elements and disable handwriting on them.
Why an HTML attribute? The explainer outlines a few alternatives that were considered, including:
pointer-events
property (e.g. pointer-events: handwriting
)touch-action
propertyinputmode
attributeAnd why not a JavaScript API instead? Haha, we won’t go there.
Anyway, handwriting
on the web… let’s see if we get a prototype!
A couple more pieces of context:
HTML Attribute to Allow/Disallow Handwriting Input originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.
Having fun with Bramus’ new Caniuse CLI tool. This’ll save lots of trips to the…
Two possible syntaxes for CSS masonry, one draft specification, and you get to share your…
Getting right to it: the CSS-Tricks Almanac got a big refresh this week! I’m guessing…
I’m working on a refresh of my personal website, what I’m calling the HD remaster.…
Only Chris, right? You’ll want to view this in a Chromium browser: CodePen Embed Fallback…
I’m a big Lynn Fisher fan. You probably are, too, if you’re reading this. Or…