Skip to content

fix(client): improve Switch component a11y - #1141

Merged
webfansplz merged 1 commit into
vuejs:mainfrom
vansh-nagar:fix-885-switch-keyboard-accessibility
Sep 28, 2026
Merged

webfansplz merged 1 commit into
vuejs:mainfrom
vansh-nagar:fix-885-switch-keyboard-accessibility

Conversation

@vansh-nagar

Copy link
Copy Markdown
Contributor

Addresses part of #885.

What changed

  • expose the switch as a checkbox with checked and disabled state
  • support Space-key toggling and remove disabled switches from the tab order
  • add a visible keyboard focus style
  • cover keyboard and disabled behavior with interaction tests

Tests

  • pnpm exec vitest run --environment jsdom packages/ui/src/components/Switch.test.ts
  • pnpm exec eslint --config=eslint.config.ts packages/ui/src/components/Switch.vue packages/ui/src/components/Switch.test.ts
  • pnpm --filter @vue/devtools-ui build

@netlify

netlify Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vue-devtools-docs canceled.

Name Link
🔨 Latest commit 4c0a5c6
🔍 Latest deploy log https://app.netlify.com/projects/vue-devtools-docs/deploys/6ab6268faffd5100087a2521

@vansh-nagar
vansh-nagar force-pushed the fix-885-switch-keyboard-accessibility branch from ff5fa46 to 4c0a5c6 Compare September 25, 2026 07:45
@vansh-nagar

Copy link
Copy Markdown
Contributor Author

Rebased this onto the v9 client after #1144 removed the old UI package. The v9 switch already uses a native checkbox, so this update adds the missing visible keyboard-focus ring and integration coverage for native semantics, model updates, disabled state, and focus styling. Focused tests, lint, formatting, and client type-checking pass.

@webfansplz webfansplz changed the title fix(ui): make switch keyboard accessible fix(client): improve Switch component a11y Sep 28, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vue/devtools-api@1141
npm i https://pkg.pr.new/@vue/devtools-kit@1141
npm i https://pkg.pr.new/vite-plugin-vue-devtools@1141

commit: 4c0a5c6

@webfansplz
webfansplz merged commit 4d427df into vuejs:main Sep 28, 2026
7 checks passed
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.

2 participants