-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[touch actions] handwriting manipulation type to distinguish panning #516
Comments
See also #512 |
Hey @flackr, I reviewed the link you posted about If I understand correctly, the benefit of the I noticed you mentioned stylus writing in that comment, but I don't see a clear and concise way to separate the two behaviors (scrolling and handwriting) with For this proposal the goal would be to enable developers to specify whether scrolling and/or handwriting are allowed independently. So the developer could allow neither, either, or both (with UA defined precedence, likely handwriting over scrolling). cc: @mustaqahmed |
I really like both the ideas here: independent control and precedence. Today in PEWG we also discussed the need for a fallback option when the page specifies |
I think I'm not fine addressing those issues later. At least we need to consider what all issues there can be if there are no reasonable fallbacks. |
If a developer specifies This doesn't just apply for devices that don't support handwriting. If you specify |
Dropping this here for interest/context https://www.youtube.com/watch?v=5nELac-Wgo0 |
It doesn't seem fine. Since one can't detect whether handwriting is supported or not, part of the page would be just unusable. |
Whether handwriting is supported or not, that part of the page would not be scrollable. I get that you're making an argument that they set handwriting because they assumed that you'd want to write in that area, but there's no difference in terms of scrolling functionality just as if There is a separate question of priority. E.g. even if both actions are allowed can you scroll over an area that accepts handwriting and/or can you write over an area that is scrollable. However, I do think touch-action or a related pointer-action is the right property for this. Developers are already using |
I agree with @flackr's argument that the intention of @smaug---- do you have a use case in mind that would make page unusable? |
I'd imagine a long page with lots of text fields, like a long form ... if each of those inputs (possibly even their containers with some extra padding around them) was set to handwriting, and the device didn't support it, then users would find it very difficult/impossible to scroll/vertically pan the page, as they'd need to try and grab any bits of page between the form fields/containers only |
The same breakage would apply to devices that do support handwriting. Wouldn't it? |
Ah, true. So it's more of a potential developer footgun in general - once you specify that an area is just going to react to handwriting, nothing else will happen (and with the current way that |
Once you specify that an area is only going to react to handwriting. It reacts to handwriting by default, nothing needs to be specified. This is why the developer advocacy would point out that you should be saying This is similar to how we react to pinch-zoom by default but if you say |
+1 for An unfortunate side-effect is any sites that might want handwriting which already specify On the BlinkOn slide #21, I included this concept with a format similar to I'm imagining this CSS
For the PR I'll be drafting this week, I plan to simply add |
@gastonrod has filed issues across multiple working groups (see links above) requesting feedback. Please feel free to leave your comments there. |
We discussed this in the call. There was a general concern about the behavior for legacy content (for which handwriting was not something developers knew they should opt into).
There were concerns about cases where you might want a different action for touch and stylus, note that no UA currently will start handwriting on touch so by default touch will scroll where a stylus will start writing. However, you would not be able to specify that touch should pan but a stylus does nothing. For this, we expect that #203 would allow differentiating. Further, we expect that developers would like to be able to opt into a different default action for devices capable of multiple, #512 suggests some extension for this in the future. We think that we might be able to defer to these other issues and suggest that authors use new properties there to both fix some of the oddities of the touch-action property and allow for the full expressivity of desired behaviors and for now focus on defining something for touch-action that best handles legacy content. |
The other thing to consider here is whether handwriting should only consider the touch-action to the nearest ancestor scroller similar to panning: https://www.w3.org/TR/pointerevents/#determining-supported-direct-manipulation-behavior If it did, I suspect the majority of legacy cases would "just work" since input fields and textareas are scrolling containers which would implicitly get handwriting re-enabled if not explicitly disabled on them. |
The way it was laid out in the explainer (and how the affected pages counter was implemented) is that having a parent that disables handwriting between the writable element and the root of the document would disable handwriting, more in line with how
Would disable I think changing the enablement to work as panning does would be very effective to mitigate how many pages we cause issues for. I'll start discussing this with Olga. Thanks for the comment 👍 |
Following the panning rules seems to be a good idea, as the Another angle this could be tackled from is to use writable elements as panning uses scrollable elements, so the spec would look something like this:
This way, we can have handwriting rules that are independent on whether or not an element is scrollable, which on the surface level at least seem unrelated. Some pros and cons for this approach: Pros:
Con:
In this page, if authors don't want any touch action in the entire page to be consumed by the UA they would have to add touch-action: none; in both the scrollable div and the input. |
I'm on the fence about restoring the The main appeal I see for restoring the However, adding the I'm also curious what the behavior should be for OOP
For OOP I think this is worth pursuing though as an experiment. I think @gastonrod's recent histogram CL will help understand the impact for these kinds of scenarios. |
Summary
Opening an issue to discuss options and alternatives to allow developers control over whether handwriting input should be allowed for elements the user agent supports handwriting input with.
Updates
Introduction
Give developers granular per-document and per-element control over which content should (dis)allow handwriting input for elements which the user agent supports handwriting to text input for.
Earlier created a proposal to introduce an HTML handwriting attribute, however upon review
touch-action
was noted as the preferred mechanism for enabling/disabling touch behaviors.Currently Android uses the combination of both
pan-x pan-y
as the mechanism to allow handwriting on eligible fields.However, this means that scrolling and handwriting are tied together, so turning off panning will turn off both handwriting and touch scrolling.
What this is
What this is not
Use Cases
composition{start|end|update}
events, or if for any reason the experience designed by website authors doesn't behave as they intend when handwriting input is available.Pros
touch-action
CSS property, developers can choose to enable handwriting or not.touch-action: manipulation
to allow stylus handwriting, and both touch scrolling and touch zoomtouch-action: pinch-zoom handwriting
to allow stylus handwriting and touch zoom, but disallow scrollingtouch-action: pinch-zoom pan-x pan-y
to allow scrolling and touch zoom, but disallow handwritingCons
touch-action
and may need treatment to enable handwriting if used in the context of editable text.auto
,inherit
, ormanipulation
on editable text or ancestors of them will need to be considered by site developers.See also:
Previous HTML Attribute proposal:
The HTML attribute proposal is a competing standards proposal and has been abandoned in favor of this CSS touch-action standards proposal. However, the discussions around the HTML attribute are still relevant here so including them here.
The text was updated successfully, but these errors were encountered: