HTML Attribute to Allow/Disallow Handwriting Input

Publikováno: 12.8.2024

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 …


HTML Attribute to Allow/Disallow Handwriting Input originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Celý článek

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.

⚠️Auto-playing media

Why an HTML attribute? The explainer outlines a few alternatives that were considered, including:

  • Extending the CSS pointer-events property (e.g. pointer-events: handwriting)
  • Extending the CSS touch-action property
  • Extending the HTML inputmode attribute

And 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.

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace