Skip to content

ergonomy.tap highlight not handled

github-actions[bot] edited this page Sep 7, 2026 · 3 revisions

ergonomy.tap-highlight-not-handled

Rule ID: ergonomy.tap-highlight-not-handled Severity: INFO Category: ergonomy Target Standards: W3C Touch Events Community Group Guidelines, Chromium Android Tap Feedback UX Standards, Google Material Design (Tactile States & Surface Elevation)


1. Overview & Core Invariant

Flags clickable non-native custom elements lacking tactile tap feedback or tap-highlight management

Core Invariant:

"Non-native clickable elements (

, ) must declare deliberate active feedback or suppress the default Android Chrome grey tap highlight box."

2. Technical Grounding & Engine Realities

On Chromium Android, tapping an element without a native button role causes the browser to flash a rigid semi-transparent grey overlay box.

Without deliberate 'active:' micro-interactions (such as 'active:scale-95' or 'active:bg-muted') or setting '[-webkit-tap-highlight-color:transparent]', the application exhibits noticeable visual glitches and lacks native tactile responsiveness.


3. Vulnerability & Risk Taxonomy

Risk Vector Severity Impact
Visual Glitches on Android Chrome LOW Rigid grey highlight rectangles flash abruptly over custom cards, badges, and list rows during touch.
Poor Tactile Feedback LOW Users cannot perceive if a touch tap registered, leading to repeated tapping and accidental duplicate submissions.

4. Non-Compliant Code Patterns (Bad Examples)

TSX (Non-native clickable div without active feedback):

<div
  role="button"
  tabIndex={0}
  onClick={handleSelectCard}
  className="p-4 bg-card border rounded-2xl"
>
  <span>Pilihan Layanan</span>
</div>

5. Compliant Implementation Patterns (Good Examples)

TSX (Deliberate active feedback with suppressed grey highlight):

<div
  role="button"
  tabIndex={0}
  onClick={handleSelectCard}
  className="p-4 bg-card border rounded-2xl active:bg-muted/60 active:scale-95 transition-transform [-webkit-tap-highlight-color:transparent]"
>
  <span>Pilihan Layanan</span>
</div>

6. How to Suppress (Ignore Directives)

If this pattern is required for an intentional exception, suppress the diagnostic using the canonical Charites Rule ID:

<!-- charites:ignore ergonomy.tap-highlight-not-handled intentional exception -->
// charites:ignore ergonomy.tap-highlight-not-handled intentional exception

7. Configuration Reference (charites.yaml)

rules:
  ergonomy.tap-highlight-not-handled:
    severity: info # error | warn | info | off

8. Architectural Domain & Verification Reference


Rule Categories

A11y (16 rules)
Browser (12 rules)
Cls (16 rules)
Design (1 rules)
Ergonomy (5 rules)
Inp (16 rules)
Lcp (16 rules)
Mobile (5 rules)
Performance (16 rules)
Pwa (10 rules)
Responsive (18 rules)
Semantic (1 rules)
Theme (32 rules)
Ux (20 rules)

Clone this wiki locally