Skip to content

fix(defineShortcuts): improve chained shortcuts and add test coverage#5747

Closed
al1maher wants to merge 2 commits intonuxt:v4from
al1maher:fix/define-shortcuts-key-sequences
Closed

fix(defineShortcuts): improve chained shortcuts and add test coverage#5747
al1maher wants to merge 2 commits intonuxt:v4from
al1maher:fix/define-shortcuts-key-sequences

Conversation

@al1maher
Copy link
Copy Markdown
Contributor

@al1maher al1maher commented Dec 23, 2025

🔗 Linked issue

Resolves #5654

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This PR introduces two improvements to the defineShortcuts composable:

  1. Chained shortcut handling:

    • Chained shortcuts (e.g., 'f-h') now properly override single key shortcuts when the same keys are used both individually and in a sequence.
    • This ensures that pressing 'f' followed quickly by 'h' triggers 'f-h', while pressing 'f' alone still triggers the single key handler.
  2. Test coverage:

    • Adds a comprehensive test suite covering single keys, key chains, and layout-independent mode.
    • Ensures correct behavior across different keyboard layouts and prevents regressions in chained key handling.

Future work may include tests for modifier keys (Ctrl, Shift, Meta) and more complex combinations.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

…the same keys are used both as indvidual handlers and in chained sequences
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Dec 23, 2025

npm i https://pkg.pr.new/@nuxt/ui@5747

commit: e503ab7

@al1maher al1maher changed the title Fix (defineShortcuts): chained shortcuts issue and add test coverage fix (defineShortcuts): chained shortcuts issue and add test coverage Dec 23, 2025
@benjamincanac benjamincanac changed the title fix (defineShortcuts): chained shortcuts issue and add test coverage fix(defineShortcuts): improve chained shortcuts and add test coverage Jan 5, 2026
@al1maher al1maher closed this by deleting the head repository Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

defineShortcuts: Wrong handling of key sequences

1 participant