Repository navigation
feat: pass a details object to change callbacks - #979
Open
rohanchkrabrty wants to merge 3 commits into
Open
rohanchkrabrty wants to merge 3 commits into
rohanchkrabrty wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
This was referenced Oct 19, 2026
rohanchkrabrty
force-pushed
the
feat/change-event-details
branch
from
October 20, 2026 08:56
d888724 to
5b27067
Compare
This branch was successfully deployed
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
Change callbacks pass a second argument after the value. Components that wrap Base UI forward Base UI's
eventDetails: AccordiononValueChange, SelectonValueChangeandonOpenChange, ComboboxonValueChangeandonInputValueChange, Menu and ContextMenuonInputValueChange, Sidebar.Group and ReasoningonOpenChange. When a callback callseventDetails.cancel(), these components keep their current state, as Base UI does.Components that own their state pass a
detailsobject withreasonandevent, built by a new shared helper,createChangeDetailsinpackages/react/shared/change-details.ts(typeChangeDetails): SidebaronOpenChange, CodeBlockonCollapseChange, ChatPanelonModeChange, DataViewonViewChange, andonOpenChangeon Editor.SlashMenu, Editor.Mentions and PromptInput.Mentions.Breaking: TextArea
onValueChangepasses Base UIeventDetails(built withcreateChangeEventDetails('none', event.nativeEvent)) in place of the ReactChangeEvent. ColorPickeronValueChangepassesdetails.mode, and FilterChiponValueChangepassesdetails.operation, in place of a string second argument. The upgrading page has the old and new signatures.Docs: props tables for every changed callback, the TextArea, ColorPicker and FilterChip pages, and the consumer skill.
Tests: existing assertions check the second argument. Accordion, DataView and Reasoning get one test each, and Select gets one for
cancel().I have followed the pull request section of the contributing guide.
Decisions
detailshas the shape of Base UI's generic event details:reason,event(a plainEventwhen there is no native one), plus the component's own fields. It has nocancel(), because these components do not let a callback cancel the change.details, the same as the other components that own their state.trigger-press. ColorPicker uses the Slider reasons (track-press,drag,keyboard,input-change). FilterChip forwards the reason from its Select or CalendarPreview, and usesnonefor the text input. DataView forwards the Tabs reason.openfrom the editor state, so theirreasonis alwaysnone.createChangeEventDetails: Reasoning auto-open while streaming (none), the Menu search reset on close (input-clear, as Base UI Combobox does), and Combobox chip removal (chip-remove-press, with a plainEvent, because the chip'sonRemovegets no event).<textarea>, socancel()on itseventDetailsdoes not stop the change.useSidebar().setOpenanduseDataView().setActiveViewtake optional details. Without them, the reason isnone.onValueChange, ColorPickeronModeChange, FilterChiponOperationChangeand SelectonSearch. No new types are exported from the package.Overlap with open PRs
select-root.tsx,combobox-root.tsx,combobox-input.tsxand the Select and Combobox tests and docs. feat: [combobox] use base ui chips, clear, empty, and status #954 replaces the Combobox chip path that buildschip-remove-pressdetails here.*-content.tsx, the input callback in each*-root.tsx, andonInputValueChangein bothprops.tsfiles. Expect small conflicts.