From d3b9e08cc792ed862e5702b38155e1d0a479058e Mon Sep 17 00:00:00 2001 From: Holger Jeromin Date: Fri, 1 Dec 2023 11:57:24 +0100 Subject: [PATCH] Align touchcancel and pointercancel examples Aligns touchcancel and pointercancel examples. Adds a further example from iPhone 11 with 5 maxtouchpoints. Reference the cancel events in the corresponding up events. --- .../en-us/web/api/element/pointercancel_event/index.md | 1 + files/en-us/web/api/element/pointerup_event/index.md | 2 +- files/en-us/web/api/element/touchcancel_event/index.md | 10 +++++++++- files/en-us/web/api/element/touchend_event/index.md | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/files/en-us/web/api/element/pointercancel_event/index.md b/files/en-us/web/api/element/pointercancel_event/index.md index ede2833f9b73695..ac2d7d5434d1e00 100644 --- a/files/en-us/web/api/element/pointercancel_event/index.md +++ b/files/en-us/web/api/element/pointercancel_event/index.md @@ -16,6 +16,7 @@ Some examples of situations that will trigger a `pointercancel` event: - The device's screen orientation is changed while the pointer is active. - The browser decides that the user started pointer input accidentally. This can happen if, for example, the hardware supports palm rejection to prevent a hand resting on the display while using a stylus from accidentally triggering events. - The {{cssxref("touch-action")}} CSS property prevents the input from continuing. +- When the user interacted with too many simultaneous pointers the browser can fire this event for all existing pointers (even if they are still touching the screen). > **Note:** After the `pointercancel` event is fired, the browser will also send {{domxref("Element/pointerout_event", "pointerout")}} followed by {{domxref("Element/pointerleave_event", "pointerleave")}}. diff --git a/files/en-us/web/api/element/pointerup_event/index.md b/files/en-us/web/api/element/pointerup_event/index.md index 7b9a36b2b00fea2..4b7108320b9c573 100644 --- a/files/en-us/web/api/element/pointerup_event/index.md +++ b/files/en-us/web/api/element/pointerup_event/index.md @@ -8,7 +8,7 @@ browser-compat: api.Element.pointerup_event {{APIRef}} -The `pointerup` event is fired when a pointer is no longer active. +The `pointerup` event is fired when a pointer is no longer active. Remember that it is possible to get a [`pointercancel`](/en-US/docs/Web/API/Element/pointercancel_event) event instead. ## Syntax diff --git a/files/en-us/web/api/element/touchcancel_event/index.md b/files/en-us/web/api/element/touchcancel_event/index.md index 98b4f357273612d..d35b2b90116d6fb 100644 --- a/files/en-us/web/api/element/touchcancel_event/index.md +++ b/files/en-us/web/api/element/touchcancel_event/index.md @@ -8,7 +8,15 @@ browser-compat: api.Element.touchcancel_event {{APIRef}} -The `touchcancel` event is fired when one or more touch points have been disrupted in an implementation-specific manner (for example, too many touch points are created). +The `touchcancel` event is fired when one or more touch points have been disrupted in an implementation-specific manner. + +Some examples of situations that will trigger a `touchcancel` event: + +- A hardware event occurs that cancels the touch activities. This may include, for example, the user switching applications using an application switcher interface or the "home" button on a mobile device. +- The device's screen orientation is changed while the touch is active. +- The browser decides that the user started touch input accidentally. This can happen if, for example, the hardware supports palm rejection to prevent a hand resting on the display while using a stylus from accidentally triggering events. +- The {{cssxref("touch-action")}} CSS property prevents the input from continuing. +- When the user interacted with too many simultaneous fingers the browser can fire this event for all existing pointers (even if they are still touching the screen). ## Syntax diff --git a/files/en-us/web/api/element/touchend_event/index.md b/files/en-us/web/api/element/touchend_event/index.md index cd422086bc73f96..7b26f074475ef02 100644 --- a/files/en-us/web/api/element/touchend_event/index.md +++ b/files/en-us/web/api/element/touchend_event/index.md @@ -8,7 +8,7 @@ browser-compat: api.Element.touchend_event {{APIRef}} -The `touchend` event fires when one or more touch points are removed from the touch surface. +The `touchend` event fires when one or more touch points are removed from the touch surface. Remember that it is possible to get a [`touchcancel`](/en-US/docs/Web/API/Element/touchcancel_event) event instead. ## Syntax