Skip to content

fix(command-palette): accept HTML input attributes on CommandPalette.Input#451

Merged
mattrothenberg merged 2 commits intocloudflare:mainfrom
mattrothenberg:fix/command-palette-input-html-attrs
Apr 27, 2026
Merged

fix(command-palette): accept HTML input attributes on CommandPalette.Input#451
mattrothenberg merged 2 commits intocloudflare:mainfrom
mattrothenberg:fix/command-palette-input-html-attrs

Conversation

@mattrothenberg
Copy link
Copy Markdown
Collaborator

Summary

  • CommandPalette.Input had an inline prop type that only declared 6 specific props (autoFocus, placeholder, className, onKeyDown, leading, trailing). Passing standard HTML input attributes like autoComplete, autoCorrect, spellCheck, or data-* caused TypeScript errors — even though the rest spread already forwarded them to the underlying <Autocomplete.Input> at runtime.

  • Extends PanelInput props with InputHTMLAttributes<HTMLInputElement> so consumers can suppress browser autocomplete, spellcheck, and password manager overlays without type errors.

  • Exports the new CommandPaletteInputProps type from the package.

  • Adds a docs demo (CommandPaletteNoAutocompleteDemo) showing usage of autoComplete="off", autoCorrect="off", spellCheck={false}, and data-1p-ignore/data-lpignore attributes.

  • 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.

…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
@mattrothenberg
Copy link
Copy Markdown
Collaborator Author

/bonk

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 27, 2026

npm i https://pkg.pr.new/@cloudflare/kumo@451

commit: ff42ccb

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

Docs Preview

View docs preview

Commit: ff42ccb

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

Visual Regression Report — 9 changed, 28 unchanged

9 screenshot(s) with visual changes:

Button / Loading State

2 px (0%) changed

Before After Diff
Before After Diff

Dialog / Dialog With Actions

138 px (0.14%) changed

Before After Diff
Before After Diff

Select / Select Sizes

599 px (0.32%) changed

Before After Diff
Before After Diff

Select / Select With Field

635 px (0.54%) changed

Before After Diff
Before After Diff

Select / Select Placeholder

418 px (0.41%) changed

Before After Diff
Before After Diff

Select / Select With Tooltip

294 px (0.29%) changed

Before After Diff
Before After Diff

Select / Select Loading

0 px (0%) changed

Before After Diff
Before After Diff

Select / Select Long List

898 px (0.76%) changed

Before After Diff
Before After Diff

Select (Open)

0 px (0%) changed

Before After Diff
Before After Diff
28 screenshot(s) unchanged
  • Button / Basic
  • Button / Variant: Primary
  • Button / Variant: Secondary
  • Button / Variant: Ghost
  • Button / Variant: Destructive
  • Button / Variant: Outline
  • Button / Variant: Secondary Destructive
  • Button / Sizes
  • Button / With Icon
  • Button / Icon Only
  • Button / Disabled State
  • Button / Title
  • Dialog / Dialog Basic
  • Dialog / Dialog Alert
  • Dialog / Dialog Confirmation
  • Dialog / Dialog With Select
  • Dialog / Dialog With Combobox
  • Dialog / Dialog With Dropdown
  • Dialog (Open)
  • Select / Select Basic
  • Select / Select Without Label
  • Select / Select Custom Rendering
  • Select / Select Multiple
  • Select / Select Complex
  • Select / Select Disabled Options
  • Select / Select Disabled Items
  • Select / Select Grouped
  • Select / Select Grouped With Disabled

Generated by Kumo Visual Regression

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Apr 27, 2026

@mattrothenberg Bonk workflow was cancelled.

View workflow run · To retry, trigger Bonk again.

@mattrothenberg
Copy link
Copy Markdown
Collaborator Author

/bonk

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment thread packages/kumo/src/components/command-palette/types.ts Outdated
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Apr 27, 2026

Review submitted and approved

This is a clean, well-scoped type-level fix that:

  1. Extends the props interface with InputHTMLAttributes<HTMLInputElement> (minus non-input attributes)
  2. Exports the new type from both the component index and package barrel
  3. Includes practical documentation demonstrating password manager suppression attributes
  4. Adds an appropriate changeset (patch level)

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 autoComplete="off" or data-1p-ignore.

github run

…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.
@mattrothenberg mattrothenberg merged commit 30bfd82 into cloudflare:main Apr 27, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant