Skip to content

fix: trigger button click from keyboard activation - #2926

Open
rajanpanth wants to merge 1 commit into
vuejs:mainfrom
rajanpanth:fix-button-keydown-activation
Open

fix: trigger button click from keyboard activation#2926
rajanpanth wants to merge 1 commit into
vuejs:mainfrom
rajanpanth:fix-button-keydown-activation

Conversation

@rajanpanth

Copy link
Copy Markdown

Description

Fixes #2545.

wrapper.trigger('keydown.enter') and wrapper.trigger('keydown.space') now synthesize the browser-style click activation for enabled <button> elements. The synthesized click is only dispatched if the keydown event is not canceled, so handlers using .prevent can suppress activation like they do in the browser.

Validation

  • corepack pnpm vitest run tests/trigger.spec.ts
  • corepack pnpm exec oxfmt --check src/baseWrapper.ts tests/trigger.spec.ts
  • corepack pnpm exec oxlint src/baseWrapper.ts tests/trigger.spec.ts (exits 0; existing warning-only findings remain in the file)
  • corepack pnpm run build
  • git diff --check

@netlify

netlify Bot commented Aug 16, 2026

Copy link
Copy Markdown

Deploy Preview for vue-test-utils-docs ready!

Name Link
🔨 Latest commit 50620b8
🔍 Latest deploy log https://app.netlify.com/projects/vue-test-utils-docs/deploys/6a81b9dd0eacef000894cc75
😎 Deploy Preview https://deploy-preview-2926--vue-test-utils-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

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.

Bug: Keydown.enter and Keydown.space do not emit the click event on buttons

1 participant