Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

Disabled elements cannot be interacted with, so they shouldn't be flagged for failing WCAG 2.5.8 minimum target size (24x24px).

Changes

  • src/rules/target-size.ts: Skip elements with disabled attribute in the target-size check
  • tests/target-size.ts: Added tests for disabled button, input, select, and textarea elements
// Skip disabled elements (they cannot be interacted with)
if ((target as HTMLElement).hasAttribute("disabled")) {
  continue;
}

Follows existing pattern used in frame-focusable-content.ts and aria-hidden-focus.ts.

Original prompt

This section details on the original issue you should resolve

<issue_title>target-size should exclude disabled elements.</issue_title>
<issue_description>This probably just means elements with the disabled attribute for now but could mean something else in the future.</issue_description>

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

The target-size rule now skips elements with the `disabled` attribute since
disabled elements cannot be interacted with and don't need to meet the
WCAG 2.5.8 minimum target size requirement.

Added tests for disabled button, input, select, and textarea elements.

Co-authored-by: koddsson <318208+koddsson@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix target-size to exclude disabled elements Exclude disabled elements from target-size rule Nov 25, 2025
Copilot AI requested a review from koddsson November 25, 2025 12:42
Copy link
Owner

@koddsson koddsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍🏻

@koddsson koddsson marked this pull request as ready for review November 25, 2025 13:00
@koddsson koddsson enabled auto-merge (squash) November 25, 2025 13:00
@koddsson koddsson merged commit bba9377 into main Dec 1, 2025
2 of 5 checks passed
@koddsson koddsson deleted the copilot/fix-target-size-disabled-elements branch December 1, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

target-size should exclude disabled elements.

2 participants