Repository navigation
fix(hub-ui): dont throw on browser autocomplete - #471
Conversation
|
@OrbisK is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
👁️🗨️ Review this pull request with grouped, summarized diffs at: raw result💭 analyzed by {
"headSha": "0b1a6099e90fa7c73ceb7d78c216ecc37cc024d3",
"result": {
"overallSummary": "Fixes a runtime error triggered by Chrome's native autocomplete/autofill, which dispatches keydown events with `key` set to `undefined` instead of an empty string, crashing `normalizeKeyEvent`. Adds a defensive fallback and corresponding unit tests.",
"groups": [
{
"key": "fix",
"label": "Fix autocomplete crash",
"summary": "Guards against `undefined` `key` values that Chrome's native autofill dispatches on keydown events, which previously caused a runtime error in `normalizeKeyEvent`.",
"category": "core",
"filePaths": [
"packages/hub-ui/src/client/state/keybindings.ts"
],
"lineNotes": [
{
"path": "packages/hub-ui/src/client/state/keybindings.ts",
"side": "additions",
"line": 33,
"text": "Falls back to empty string when `e.key` is `undefined`, matching the related vueuse fix.",
"critical": true
}
]
},
{
"key": "tests",
"label": "Tests for normalizeKeyEvent",
"summary": "Adds unit tests covering the autofill edge case (missing `key`) and a regular shortcut normalization case.",
"category": "tests",
"filePaths": [
"packages/hub-ui/src/client/state/keybindings.test.ts"
]
}
],
"schemaVersion": 1,
"source": "llm",
"generatedAt": "2026-10-30T12:57:10.173Z",
"model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
"locale": "en"
}
} |
For some reason chrome default autocomplete emits the key as
undefinednot''.We had a releated issue at vueuse: vueuse/vueuse#5225
The current implementation throws an runtime error when using autocomplete on the page.