dbeaver/pro#10365 Filter combobox items when custom values are allowed - #4685
sergeyteleshev wants to merge 1 commit into
Conversation
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The updated filtering path can throw at runtime due to string-method calls on non-string values, and the disclosure can remain visible even when the popover is suppressed.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
This PR updates the core-blocks Combobox form control behavior in “custom value” mode so that item suggestions are filtered by the current input, and the suggestions popover is hidden when there are no matches.
Changes:
- Remove the
allowCustomValueshort-circuit from item visibility so filtering applies in custom-value mode. - Suppress rendering the popover when
allowCustomValueis enabled and the filtered list is empty.
| File | Description |
|---|---|
| webapp/packages/core-blocks/src/FormControls/Combobox.tsx | Applies filtering in custom-value mode and conditionally hides the popover when there are no matching items. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const itemTitle = titleSelector?.(item); | ||
| const itemIcon = iconSelector?.(item); | ||
| const itemDisabled = isDisabled?.(item); | ||
|
|
||
| const isVisible = | ||
| allowCustomValue || inputValue === null || !inputValue.trim() || itemValue.toLowerCase().includes(inputValue.trim().toLowerCase()); | ||
| const isVisible = inputValue === null || !inputValue.trim() || itemValue.toLowerCase().includes(inputValue.trim().toLowerCase()); |
| {displayPopover && <ComboboxDisclosure disabled={disabled || loading || readOnly} className="cb-combobox__disclosure-icon" />} | ||
| </> | ||
| )} | ||
| {icon && <div className="tw:absolute tw:left-3 tw:w-4 tw:h-4">{typeof icon === 'string' ? <IconOrImage icon={icon} /> : icon}</div>} | ||
| {displayPopover && ( | ||
| {displayPopover && (!allowCustomValue || filteredItems.length > 0) && ( |

Closes dbeaver/pro#10365
Summary
Verification