fix(docs): use onClick instead of onSelect on DropdownMenu.Item#467
fix(docs): use onClick instead of onSelect on DropdownMenu.Item#467mattrothenberg merged 5 commits intomainfrom
Conversation
DropdownMenu.Item does not have an onSelect prop — the only explicitly typed click handler from Base UI's MenuItem is onClick. onSelect only appeared to work because it's a native DOM event that React passes through to the underlying div. The CloudflareLogo demo used onSelect on 4 dropdown items, which propagated into component-registry.md and component-registry.json — the files AI agents consume for API guidance. Changes: - Fix onSelect → onClick in CloudflareLogoDemo - Add DropdownOnClickDemo showing the correct onClick pattern - Fix registry codegen to fall back to dir-name-based demo lookup when component export name differs from demo file name (e.g. DropdownMenu vs Dropdown), restoring 6 missing examples
|
/bonk |
PR #467 SummaryTitle: fix(docs): use onClick instead of onSelect on DropdownMenu.Item What ChangedThis PR fixes three interconnected issues with the DropdownMenu component documentation and registry: 1. Fixed incorrect prop usage (
2. Added canonical demo example (
3. Fixed registry codegen lookup bug (
Files Changed
VerificationThe fix was verified by running
|
commit: |
Docs PreviewCommit: |
|
/bonk can you approve the PR too? |
|
UnknownError: ProviderInitError |
|
@mattrothenberg Bonk workflow failed. Check the logs for details. View workflow run · To retry, trigger Bonk again. |
…PONENT_PROPS The sub-component props extraction regex can't handle React.forwardRef with inline intersection types, which is how all DropdownMenu sub-components are defined. Add manual prop definitions for Item, LinkItem, Content, SubTrigger, CheckboxItem, RadioGroup, RadioItem, and Label — verified against Base UI type definitions.
|
/bonk approve please |
There was a problem hiding this comment.
LGTM! This PR addresses three important issues:
-
Corrects invalid prop usage - Changing to on is the right fix since is not an explicitly typed prop on the Base UI MenuItem component.
-
Adds canonical demo - The new provides a clear reference pattern for developers and AI agents.
-
Fixes registry codegen bug - The fallback to properly handles the name mismatch between demo filenames and component export names, restoring 6 Dropdown demos to the AI registry.
The changeset is included, and the verification steps confirm the fix works as expected.
There was a problem hiding this comment.
LGTM! This PR addresses three important issues:
-
Corrects invalid prop usage - Changing
onSelecttoonClickonDropdownMenu.Itemis the right fix sinceonSelectis not an explicitly typed prop on the Base UI MenuItem component. -
Adds canonical demo - The new
DropdownOnClickDemoprovides a clear reference pattern for developers and AI agents. -
Fixes registry codegen bug - The fallback to
toPascalCase(config.dirName)properly handles the name mismatch between demo filenames and component export names, restoring 6 Dropdown demos to the AI registry.
The changeset is included, and the verification steps confirm the fix works as expected.
|
✅ Approved PR #467 The PR has been approved. Here's a summary of what was reviewed:
|















Summary
onSelect→onClickonDropdownMenu.IteminCloudflareLogoDemo.tsx.DropdownMenu.Itemdoes not have anonSelectprop — the only explicitly typed click handler from Base UI'sMenuItemisonClick.onSelectonly appeared to work because it's a native DOM event (GlobalEventHandlers.onselect) that React passes through to the underlying<div>.DropdownOnClickDemoto the canonical Dropdown demos showing the correctonClickpattern, so AI agents and developers have a clear reference.DropdownMenuvsDropdown). This was silently dropping all 6 Dropdown demos from the AI registry.Details
The
CloudflareLogoDemousedonSelecton 4DropdownMenu.Iteminstances. Since that demo feeds into the registry codegen pipeline, the bad pattern propagated intocomponent-registry.mdandcomponent-registry.json— the files AI agents consume for API guidance.The registry codegen also had a name mismatch bug: demo metadata keys are derived from filenames (
DropdownDemo.tsx→"Dropdown") but the registry looks up by component export name ("DropdownMenu"). The fallback totoPascalCase(config.dirName)fixes this for all affected components.codegen:registry --no-cacheand confirming DropdownMenu examples went from 0 → 6, allonSelecton dropdown items removed from registry output