Repository navigation
Open
Open
Copy link
Labels
triageAwaiting initial review and prioritizationAwaiting initial review and prioritization
Description
Environment
| Operating system | Linux 7.3.4-1-cachyos |
| Node.js version | v26.13.1 |
| nuxt/cli version | 4.0.3 |
| Package manager | pnpm@12.5.1 |
| Nuxt version | 4.6.4 |
| Nitro version | 2.13.6 |
| Builder | vite@8.3.5 |
| Config | compatibilityDate, css, devtools, eslint, experimental, hooks, i18n, icon, modules, nitro, nodemailer, oidc, postcss, routeRules, runtimeConfig, ssr, vite |
| Modules | @nuxt/eslint@1.17.0, @nuxt/ui@4.12.0, @eitea/lmrui@0.0.7, nuxt-nodemailer@1.1.4, nuxt-email-renderer@3.0.0, nuxt-oidc-auth@1.0.0-beta.13, @nuxtjs/i18n@10.6.0 |
Is this bug related to Nuxt or Vue?
Nuxt
Package
v4.x
Version
v4.6.4
Reproduction
Description
In my opinion, the current way that defineShortcuts() handles bubbling is extremely error-prone.
- shortcuts generally get bubbled through popups
- precedence is unintuitive and unhelpful (root-level defineShortcut takes precedence over modals' own escape shortcut for example)
- un-dismissable Popovers don't let escape through at all
(but defining an escape key to close the parent modal would mess with other popups, as described)
Additional context
In my opinion, defineShortcuts absolutely needs the following to be useful:
- some way to constrain them to keypress events from inside an arbitrary component - named inputs are not enough! (and that doesn't even always work, but I didn't debug that)
- some way to ignore keypresses from inside other modals - probably best to have a per-shortcut parameter
globalwhich defaults to true for backwards compat. - un-dismissable Popovers should bubble their escape key (should probably also be configurable, so you can still force unescapable popups - I suggest changing the dismissible property to
bool | 'bubble') - there should also be a way to programmatically bubble a keypress (by returning false or something) so programmers can choose to constrain a shortcut to arbitrary states without having to bother with the ref (which is a truly awful experience in my opinion)
Marked as a bug instead of a feature request because while the current behaviour could be useful in some situations (truly global shortcuts), it's so unintuitive in most situations that I consider it a bug.
Logs
Metadata
Metadata
Assignees
Labels
triageAwaiting initial review and prioritizationAwaiting initial review and prioritization
Activity