Skip to main content
Logo Appt Light

Success Criterion 2.5.2 - Level A

Pointer Cancellation

Ensure it is possible to cancel touches. Buttons should only activate by clicking and not by touching. This gives the user the option to cancel the activation.

Impact

Being able to cancel touches is helpful for everyone to prevent accidental touches. This is especially helpful for people with visual, cognitive or motor disabilities.

Check

Is it possible to cancel touches, to avoid click events?

This can be tested without assistive technologies.

Solution

Support input cancellation

On Android, you should avoid using the ACTION_DOWN event of OnTouchListener, because users will not be able to cancel their interaction. Actions should only be activated through an ACTION_UP event. Use an OnClickListener instead, because it has built-in support for cancellation.

webView.setOnTouchListener { _, event ->
    if (event == MotionEvent.ACTION_DOWN) {
        // Use OnClickListener instead
    }
}

Resources

Feedback?

Let us know!