Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP1universalStack: react
accessibilitya11ykeyboardevents
Trigger UI on focus, not only click, for keyboard accessibility
Handlers that reveal options on interaction should respond to focus as well as click so keyboard/tab users get the same behavior.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codejsx
| 1 | <input onClick={this.showOptions} /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejsx
| 1 | <input onFocus={this.showOptions} /> |
Explanation (EN)
Objašnjenje (HR)