Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tricky-impalas-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cube-dev/ui-kit": patch
---

Fix leakage of `description` prop to the trigger in Select. Add `triggerDescription` prop.
2 changes: 1 addition & 1 deletion src/components/fields/Select/Select.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ A select allows users to choose a single option from a list of predefined choice
- `true` - Auto tooltip on overflow (shows selected value when truncated)
- `object` - Advanced configuration with optional `auto` property

**description** - Text description displayed within the trigger button. Different from field-level description provided by FieldWrapper.
**triggerDescription** - Text description displayed within the trigger button. Different from field-level description provided by FieldWrapper.

**descriptionPlacement** - Controls how description is positioned: `inline`, `block`, or `auto`.

Expand Down
6 changes: 3 additions & 3 deletions src/components/fields/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export interface CubeSelectBaseProps<T>
prefix?: ReactNode;
suffix?: ReactNode;
/** Description text for the trigger. Note: Different from field-level description. */
description?: ReactNode;
triggerDescription?: ReactNode;
descriptionPlacement?: 'inline' | 'block';
/** Keyboard shortcut that triggers the select when pressed */
hotkeys?: string;
Expand Down Expand Up @@ -277,7 +277,7 @@ function Select<T extends object>(
overlayStyles,
suffix,
message,
description,
triggerDescription,
descriptionPlacement,
hotkeys,
direction = 'bottom',
Expand Down Expand Up @@ -462,7 +462,7 @@ function Select<T extends object>(
<DirectionIcon to={state.isOpen ? 'up' : 'down'} />
)
}
description={description}
description={triggerDescription}
descriptionPlacement={descriptionPlacement}
hotkeys={hotkeys}
tooltip={tooltip}
Expand Down
Loading