Skip to content

Conversation

NoiseFan
Copy link
Contributor

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.
⚠️ Slowing down new functions

Warning: Slowing down new functions

As the VueUse audience continues to grow, we have been inundated with an overwhelming number of feature requests and pull requests. As a result, maintaining the project has become increasingly challenging and has stretched our capacity to its limits. As such, in the near future, we may need to slow down our acceptance of new features and prioritize the stability and quality of existing functions. Please note that new features for VueUse may not be accepted at this time. If you have any new ideas, we suggest that you first incorporate them into your own codebase, iterate on them to suit your needs, and assess their generalizability. If you strongly believe that your ideas are beneficial to the community, you may submit a pull request along with your use cases, and we would be happy to review and discuss them. Thank you for your understanding.


Description

What this PR solves:

  • Add 7 test cases covering all functionality of useKeyModifier.
  • Move dispatchKeyboardEvent to packages/.test directory for unified management.
  • Remove duplicate dispatchKeyboardEvent implementations in useMagicKeys.

Additional context

This PR only adds tests without modifying the existing useKeyModifier implementation.
The test file follows the project's testing conventions and uses the same testing utilities.
No breaking changes or new dependencies are introduced.

- Move 'dispatchKeyboardEvent' to packages/.test directory for unified management.
- Remove duplicate `dispatchKeyboardEvent` implementations in useMagicKeys.
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 21, 2025
Copy link

pkg-pr-new bot commented Sep 21, 2025

Open in StackBlitz

@vueuse/components

npm i https://pkg.pr.new/@vueuse/components@5051

@vueuse/core

npm i https://pkg.pr.new/@vueuse/core@5051

@vueuse/electron

npm i https://pkg.pr.new/@vueuse/electron@5051

@vueuse/firebase

npm i https://pkg.pr.new/@vueuse/firebase@5051

@vueuse/integrations

npm i https://pkg.pr.new/@vueuse/integrations@5051

@vueuse/math

npm i https://pkg.pr.new/@vueuse/math@5051

@vueuse/metadata

npm i https://pkg.pr.new/@vueuse/metadata@5051

@vueuse/nuxt

npm i https://pkg.pr.new/@vueuse/nuxt@5051

@vueuse/router

npm i https://pkg.pr.new/@vueuse/router@5051

@vueuse/rxjs

npm i https://pkg.pr.new/@vueuse/rxjs@5051

@vueuse/shared

npm i https://pkg.pr.new/@vueuse/shared@5051

commit: aa03377

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 21, 2025
describe('params', () => {
describe('events', () => {
it('should be work with custom events', () => {
const state = useKeyModifier('Alt', { events: ['mousedown'] })
Copy link
Collaborator

Choose a reason for hiding this comment

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

in this test can you use an actual custom event to prove it works with arbitrary ones?

e.g. testevent and new CustomEvent('testevent')

Copy link
Collaborator

@43081j 43081j 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, i would update one test i left a comment on but its not a blocker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants