Using native controls to ensure functionality is triggered on the up-event.

Important Information about Techniques

See Understanding Techniques for WCAG Success Criteria for important information about the usage of these informative techniques and how they relate to the normative WCAG 2.1 success criteria. The Applicability section explains the scope of the technique, and the presence of techniques for a specific technology does not imply that the technology can be used in all situations to create content that meets WCAG 2.1.

Applicability

This technique applies to nearly all technologies.

This technique relates to Success Criterion 2.5.2: Pointer Cancellation (Sufficient).

Description

The objective of this technique is to ensure that users who attempt to interact with a control do not trigger the action of the event accidentally. This can be accomplished most directly by relying on the pointer's up-event (for example, the onclick or mouseup event).

The easiest way to meet this success criteria is simply to use the default behavior of controls and not override that behaviour with an explicit down-event trigger. The up-event is the default behaviour for almost all controls and any programming or markup language.

In native languages where a control is fired on the down event it is usually for good reason and is easily recoverable. For instance, an HTML input element could have the cursor enter the editable area on the “pointer down” event, because the action is trivially reversible, and as such meets the requirements of the Pointer Cancellation SC. This is because if the user realizes they made a mistake after pressing down the control, they can simply move their pointer away from the hit area while still holding down the pointer, then release their pointer and the event is not triggered.

Examples

Example 1: Using an native onclick event in JavaScript

In JavaScript native onclick events are triggered on the up-event by default.

Example 3: Using a native button in iOS or Android

In native buttons in iOS and Android onclick events are triggered on the up-event by default.

Note

The WCAG standard itself applies to web pages at a URL, and therefore this example is provided as helpful supplementary advice for those looking to implement the WCAG2ICT for native applications.

Resources

Resources are for information purposes only, no endorsement implied.

Tests

Procedure

For all clickable controls:

  1. Activate the down-event then move the pointer outside the target before triggering the up-event, and then release the pointer to trigger the up-event.
  2. Check that the action was not triggered when the pointer is released outside of the hit area for the target.
  3. If the action is triggered, check that the action is reversible.

Expected Results

  • Check #2 or #3 is true.