Skip to content

[FEATURE]: Add keyboard handlers to interactive elements #2167

@crivetimihai

Description

@crivetimihai

Problem

24 HTML elements have onclick handlers but no keyboard equivalents, making them inaccessible to keyboard users.

SonarQube Rule: Web:MouseEventWithoutKeyboardEquivalentCheck
Severity: MINOR

Affected Files

File Count
mcpgateway/templates/overview_partial.html 24

Fix Strategy

Add onkeypress, onkeydown, or onkeyup handlers, or use semantic HTML elements like <button> that have built-in keyboard support.

<!-- BAD -->
<div onclick="doSomething()">Click me</div>

<!-- GOOD - Option 1: Add keyboard handler -->
<div onclick="doSomething()" onkeypress="doSomething()" tabindex="0" role="button">Click me</div>

<!-- GOOD - Option 2: Use semantic element -->
<button onclick="doSomething()">Click me</button>

Metadata

Metadata

Assignees

Labels

COULDP3: Nice-to-have features with minimal impact if left out; included if time permitsenhancementNew feature or requestfrontendFrontend development (HTML, CSS, JavaScript)sonarSonarQube code quality findingsuiUser Interface

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions