Skip to content

#8612 Refactor: Prefer tag over ARIA role (part 4) - #8615

Merged
AlexeyGirin merged 5 commits into
masterfrom
copilot/refactor-prefer-tag-over-aria
Nov 21, 2025
Merged

AlexeyGirin merged 5 commits into
masterfrom
copilot/refactor-prefer-tag-over-aria

Conversation

Copilot AI commented Nov 21, 2025

Copy link
Copy Markdown
Contributor

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original prompt

This section details on the original issue you should resolve

<issue_title>Refactor: Prefer tag over ARIA role (part 4)</issue_title>
<issue_description>Problem:
Use <input type="button">, <input type="image">, <input type="reset">, <input type="submit">, or <button> instead of the "button" role to ensure accessibility across all devices.

Why is this an issue?
ARIA (Accessible Rich Internet Applications) roles are used to make web content and web applications more accessible to people with disabilities. However, you should not use an ARIA role on a generic element (like span or div) if there is a semantic HTML tag with similar functionality, just use that tag instead.

For example, instead of using a div element with a button role (<div role="button">Click me</div>), you should just use a button element (<button>Click me</button>).

Semantic HTML tags are generally preferred over ARIA roles for accessibility due to their built-in functionality, universal support by browsers and assistive technologies, simplicity, and maintainability. They come with inherent behaviors and keyboard interactions, reducing the need for additional JavaScript. Semantic HTML also enhances SEO by helping search engines better understand the content and structure of web pages. While ARIA roles are useful, they should be considered a last resort when no suitable HTML element can provide the required behavior or semantics.

<div role="button" onClick={handleClick} /* Noncompliant */>Click me</div>

Replace the ARIA role with an appropriate HTML tag.

<button onClick={handleClick}>Click me</button>

Problem locations:
packages/ketcher-react/src/script/ui/views/modal/components/document/Open/components/OpenOptions.tsx:53
packages/ketcher-react/src/script/ui/views/modal/components/meta/Settings/Accordion/Accordion.tsx:51
packages/ketcher-react/src/script/ui/views/modal/components/toolbox/Atom/Atom.tsx:261</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 21, 2025 05:48
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>
Copilot AI requested a review from AlexeyGirin November 21, 2025 05:53
@AlexeyGirin
AlexeyGirin marked this pull request as ready for review November 21, 2025 07:32
@AlexeyGirin
AlexeyGirin requested review from svvald and removed request for AlexeyGirin and NataliaLoginova November 21, 2025 07:32
@AlexeyGirin AlexeyGirin changed the title [WIP] Refactor to prefer semantic tags over ARIA roles for buttons #8612 Refactor: Prefer tag over ARIA role (part 4) Nov 21, 2025
@AlexeyGirin
AlexeyGirin merged commit 59319f2 into master Nov 21, 2025
14 of 15 checks passed
@AlexeyGirin
AlexeyGirin deleted the copilot/refactor-prefer-tag-over-aria branch November 21, 2025 11:06
AlexeyGirin added a commit that referenced this pull request Nov 21, 2025
…ite JS to TS) 16 (#8630)

* Initial plan

* Refactor cliparea.jsx to TypeScript with proper prop type validation

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* fix: Context menu remains visible after creating cyclic structure via right-click menu (#8601)

* #7326 - Preview: Delete option is unavailable when right-clicking on a bond in macro mode (#8636)

* fix: Delete option is available when right-clicking on a bond in macro mode

* test: update snapshots

* fix: Selection tool icon open dropdown menu as in Micro mode (#8621)

* #8612 Refactor: Prefer tag over ARIA role (part 4) (#8615)

* Initial plan

* Replace div role="button" with semantic button elements

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* Remove redundant aria-disabled attribute in favor of native disabled

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* f1

* f2

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>
Co-authored-by: Alexey Girin <agirin@mail.ru>

* #8504 Refactor: Variables are missing in props validation (let's rewrite JS to TS) 7 (#8616)

* Initial plan

* Convert TypeChoice.jsx to TypeScript with proper type definitions

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* Add explanatory comments for type compatibility and required props

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* #8619 Refactor: Expected a for-of loop instead of a for loop with this simple iteration (part 4) (#8620)

* Initial plan

* Refactor for loops to for-of loops in utils.js

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* #8563 Refactor: Mark the props of the component as read-only (#8622)

* Initial plan

* Mark component props as read-only using Readonly utility type

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* #8626 Refactor: Variables are missing in props validation (let's rewrite JS to TS) 18 (#8632)

* Initial plan

* Refactor buttonlist.jsx to TypeScript with proper type definitions

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* Fix parameter naming: rename 'multipl' to 'multiple' in oneOrMore function

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* #8627 Refactor: Variables are missing in props validation (let's rewrite JS to TS) 19 (#8633)

* Initial plan

* Convert ComboBox component from JSX to TypeScript with proper prop types

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* Address code review feedback - improve type safety and JSX rendering

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* #8628 Refactor: Variables are missing in props validation (let's rewrite JS to TS) 20 (#8634)

* Initial plan

* Convert errorPopover.jsx to TypeScript with proper type definitions

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* Initial plan

* f1

* f2

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>
Co-authored-by: Kristina <kristina_kasyanovskaya@epam.com>
Co-authored-by: Alexey Girin <agirin@mail.ru>
KukushkinDmi1riy pushed a commit that referenced this pull request Dec 3, 2025
* Initial plan

* Replace div role="button" with semantic button elements

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* Remove redundant aria-disabled attribute in favor of native disabled

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* f1

* f2

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>
Co-authored-by: Alexey Girin <agirin@mail.ru>
KukushkinDmi1riy pushed a commit that referenced this pull request Dec 3, 2025
…ite JS to TS) 16 (#8630)

* Initial plan

* Refactor cliparea.jsx to TypeScript with proper prop type validation

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* fix: Context menu remains visible after creating cyclic structure via right-click menu (#8601)

* #7326 - Preview: Delete option is unavailable when right-clicking on a bond in macro mode (#8636)

* fix: Delete option is available when right-clicking on a bond in macro mode

* test: update snapshots

* fix: Selection tool icon open dropdown menu as in Micro mode (#8621)

* #8612 Refactor: Prefer tag over ARIA role (part 4) (#8615)

* Initial plan

* Replace div role="button" with semantic button elements

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* Remove redundant aria-disabled attribute in favor of native disabled

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* f1

* f2

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>
Co-authored-by: Alexey Girin <agirin@mail.ru>

* #8504 Refactor: Variables are missing in props validation (let's rewrite JS to TS) 7 (#8616)

* Initial plan

* Convert TypeChoice.jsx to TypeScript with proper type definitions

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* Add explanatory comments for type compatibility and required props

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* #8619 Refactor: Expected a for-of loop instead of a for loop with this simple iteration (part 4) (#8620)

* Initial plan

* Refactor for loops to for-of loops in utils.js

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* #8563 Refactor: Mark the props of the component as read-only (#8622)

* Initial plan

* Mark component props as read-only using Readonly utility type

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* #8626 Refactor: Variables are missing in props validation (let's rewrite JS to TS) 18 (#8632)

* Initial plan

* Refactor buttonlist.jsx to TypeScript with proper type definitions

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* Fix parameter naming: rename 'multipl' to 'multiple' in oneOrMore function

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* #8627 Refactor: Variables are missing in props validation (let's rewrite JS to TS) 19 (#8633)

* Initial plan

* Convert ComboBox component from JSX to TypeScript with proper prop types

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* Address code review feedback - improve type safety and JSX rendering

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* #8628 Refactor: Variables are missing in props validation (let's rewrite JS to TS) 20 (#8634)

* Initial plan

* Convert errorPopover.jsx to TypeScript with proper type definitions

Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>

* Initial plan

* f1

* f2

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexeyGirin <26869421+AlexeyGirin@users.noreply.github.com>
Co-authored-by: Kristina <kristina_kasyanovskaya@epam.com>
Co-authored-by: Alexey Girin <agirin@mail.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Prefer tag over ARIA role (part 4)

3 participants