fix(command-palette): accept HTML input attributes on CommandPalette.Input#451
Merged
mattrothenberg merged 2 commits intocloudflare:mainfrom Apr 27, 2026
Conversation
…Input CommandPalette.Input's inline prop type only declared 6 specific props, causing TypeScript errors when passing standard HTML input attributes like autoComplete, autoCorrect, spellCheck, and data-* attributes. The rest spread already forwarded these at runtime, but the types didn't allow it. - Extend PanelInput props with InputHTMLAttributes<HTMLInputElement> - Export new CommandPaletteInputProps type from package - Add docs demo showing autoComplete/spellCheck/password-manager suppression
Collaborator
Author
|
/bonk |
commit: |
Contributor
Docs PreviewCommit: |
Contributor
Contributor
|
@mattrothenberg Bonk workflow was cancelled. View workflow run · To retry, trigger Bonk again. |
Collaborator
Author
|
/bonk |
Contributor
There was a problem hiding this comment.
Clean, well-scoped type fix that follows existing patterns.
Highlights:
- Correctly extends
InputHTMLAttributes<HTMLInputElement>with sensible omissions (children,defaultValue,defaultChecked,color) - Props properly exported from both component index and package barrel
- Good documentation with practical demo showing password manager suppression attributes (
data-1p-ignore,data-lpignore) - Changeset correctly marked as patch
The rest spread on Autocomplete.Input already forwarded these props at runtime—this change just fixes the TypeScript surface. Approved.
Contributor
|
✅ Review submitted and approved This is a clean, well-scoped type-level fix that:
The runtime behavior was already correct (props were forwarded via rest spread)—this just fixes the TypeScript surface so consumers don't get errors when passing standard HTML input attributes like |
…tProps Address review feedback: autoFocus, placeholder, className, and onKeyDown are already inherited from InputHTMLAttributes<HTMLInputElement>, so remove the redundant re-declarations. Also align the handleKeyDown callback to use React.KeyboardEvent<HTMLInputElement> for consistency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



























Summary
CommandPalette.Inputhad an inline prop type that only declared 6 specific props (autoFocus,placeholder,className,onKeyDown,leading,trailing). Passing standard HTML input attributes likeautoComplete,autoCorrect,spellCheck, ordata-*caused TypeScript errors — even though the rest spread already forwarded them to the underlying<Autocomplete.Input>at runtime.Extends
PanelInputprops withInputHTMLAttributes<HTMLInputElement>so consumers can suppress browser autocomplete, spellcheck, and password manager overlays without type errors.Exports the new
CommandPaletteInputPropstype from the package.Adds a docs demo (
CommandPaletteNoAutocompleteDemo) showing usage ofautoComplete="off",autoCorrect="off",spellCheck={false}, anddata-1p-ignore/data-lpignoreattributes.Reviews
bonk has reviewed the change
automated review not possible because: type-level fix, needs human review
Tests
Additional testing not necessary because: type-only change to props interface; runtime behavior is unchanged (rest spread already forwarded props). Verified via typecheck in both kumo and kumo-docs-astro packages.