Skip to content

fix(core/link-button): disabled link-button focus and screen reader behavior - #2662

Open
lakshmi-priya-b wants to merge 4 commits into
mainfrom
fix/IX-4344-link-button
Open

fix(core/link-button): disabled link-button focus and screen reader behavior#2662
lakshmi-priya-b wants to merge 4 commits into
mainfrom
fix/IX-4344-link-button

Conversation

@lakshmi-priya-b

@lakshmi-priya-b lakshmi-priya-b commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

💡 What is the current behavior?

A disabled link button can still receive keyboard focus via Tab.
It lacks an exposed disabled state for assistive technologies.
NVDA may announce the URL from the anchor (title) rather than only the intended label.

JIRA : IX-4344

🆕 What is the new behavior?

🏁 Checklist

A pull request can only be merged if all of these conditions are met (where applicable):

  • 🦮 Accessibility (a11y) features were implemented
  • 🗺️ Internationalization (i18n) - no hard coded strings
  • 📲 Responsiveness - components handle viewport changes and content overflow gracefully
  • 📕 Add or update a Storybook story
  • 📄 Documentation was reviewed/updated siemens/ix-docs
  • 🧪 Unit tests were added/updated and pass (pnpm test)
  • 📸 Visual regression tests were added/updated and pass (Guide)
  • 🧐 Static code analysis passes (pnpm lint)
  • 🏗️ Successful compilation (pnpm build, changes pushed)

👨‍💻 Help & support

Summary by CodeRabbit

  • Accessibility

    • Improved disabled link buttons with appropriate accessibility attributes and keyboard behavior.
    • Disabled link buttons are skipped during keyboard navigation.
  • Bug Fixes

    • Corrected disabled-state rendering so links no longer receive unintended focus.
    • Added coverage for disabled-state semantics, link attributes, hydration, and keyboard interaction.

@changeset-bot

changeset-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d6102f8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify

netlify Bot commented Jul 21, 2026

Copy link
Copy Markdown

Deploy Preview for ix-storybook ready!

Name Link
🔨 Latest commit d6102f8
🔍 Latest deploy log https://app.netlify.com/projects/ix-storybook/deploys/6a6c757ca27fe6000a7dd9ab
😎 Deploy Preview https://deploy-preview-2662--ix-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3b792658-0f47-4451-89c4-3113d508afa0

📥 Commits

Reviewing files that changed from the base of the PR and between ef3122a and bfdb9de.

📒 Files selected for processing (2)
  • packages/core/src/components/link-button/link-button.tsx
  • packages/core/src/components/link-button/test/link-button.ct.ts

📝 Walkthrough

Walkthrough

ix-link-button now exposes its disabled state through aria-disabled, removes disabled links from keyboard navigation, and applies disabled-link semantics. Playwright tests cover accessibility, rendering, attributes, and focus traversal.

Changes

Link button accessibility

Layer / File(s) Summary
Disabled link semantics and regression coverage
packages/core/src/components/link-button/link-button.tsx, packages/core/src/components/link-button/test/link-button.ct.ts
The anchor sets aria-disabled, uses tabindex="-1" when disabled, and applies role="link". Tests verify enabled rendering, accessibility, disabled-link attributes, missing href, and keyboard navigation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: lzeiml, nuke-ellington

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main accessibility fixes for disabled link-buttons.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/IX-4344-link-button

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the LinkButton component to dynamically manage aria-disabled and tabindex attributes based on its disabled state, and introduces a new component test suite (link-button.ct.ts) covering accessibility, rendering, and keyboard navigation. The feedback suggests optimizing the attribute values in link-button.tsx by using undefined instead of 'false' or 0 when enabled to prevent unnecessary DOM clutter and incorrect focus behavior. Additionally, it is recommended to expand the axe-based accessibility test to include the disabled state of the component to ensure comprehensive coverage.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/core/src/components/link-button/link-button.tsx Outdated
Comment thread packages/core/src/components/link-button/test/link-button.ct.ts
@lakshmi-priya-b
lakshmi-priya-b marked this pull request as ready for review July 24, 2026 12:28

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/core/src/components/link-button/link-button.tsx`:
- Around line 43-44: Add a packages/core changeset documenting the
consumer-visible accessibility and keyboard behavior change in the
ix-link-button component, specifically the disabled state’s aria-disabled and
tabindex handling. Use the repository’s standard changeset format and select the
appropriate release type; do not alter the implementation unless needed to
reference the change accurately.
- Around line 43-44: Update the disabled state in the LinkButton component’s
anchor rendering to add role="link" when disabled removes href, preserving its
link semantics. In
packages/core/src/components/link-button/test/link-button.ct.ts lines 50-58,
update the disabled-item assertion to use getByRole('link', ...) instead of the
current selector.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7a825db7-1a69-4d40-9e93-af93cb4f9daa

📥 Commits

Reviewing files that changed from the base of the PR and between a419241 and ef3122a.

📒 Files selected for processing (2)
  • packages/core/src/components/link-button/link-button.tsx
  • packages/core/src/components/link-button/test/link-button.ct.ts

Comment thread packages/core/src/components/link-button/link-button.tsx Outdated
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant