Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
commit: |
| @@ -80,13 +81,16 @@ export const ComboboxRoot = <Value extends unknown | unknown[]>({ | |||
| const resolvedRequired = required ?? fieldContext?.required; | |||
|
|
|||
| const [inputValue, setInputValue] = useState(''); | |||
There was a problem hiding this comment.
Use useControlled for inputValue, with the inputValue and defaultInputValue props.
There was a problem hiding this comment.
Fixed. inputValue uses useControlled with the inputValue and defaultInputValue props.
| @@ -67,9 +68,12 @@ export const ColorPickerRoot = ({ | |||
| const [internalColor, setInternalColor] = useState(() => | |||
There was a problem hiding this comment.
Use useControlled for value, the same as mode. Do the same for RangePicker value in calendar/range-picker.tsx:128.
There was a problem hiding this comment.
Fixed. value uses useControlled in ColorPicker and in RangePicker.
# Conflicts: # packages/react/components/command/command-root.tsx # packages/react/components/select/select-root.tsx
Summary
useControlledfor the controlled and uncontrolled state of Sidebar, Sidebar.Group, Select, DataView, Menu, ContextMenu and their submenus, ComboboxvalueandinputValue, Command, CodeBlock, ColorPickervalueandmode, and RangePickervalue, in place of the hand-written merges. Tour, Reasoning, ChatPanel, PromptInput and CalendarPreview already use it, so this follows them instead of adding a new hook.undefinedon the first render and set later is ignored, and a controlled prop that later becomesundefinedno longer falls back to internal state. Base UI logs a warning in development for both. The Base UI roots under Select, Combobox and Command already did this forvalue, and the value Apsara reads now matches them.CodeBlockcallingonCollapseChangewith the wrong value whencollapsedis controlled, and calling it twice per click in Strict Mode.''to the language Select ofCodeBlock.LanguageSelectuntil aCodeBlock.Codesets the value, so its trigger shows the language whenCodeBlockhas novalueordefaultValue.Closes #876