diff --git a/.changeset/tricky-impalas-prove.md b/.changeset/tricky-impalas-prove.md new file mode 100644 index 000000000..c8dbcb28b --- /dev/null +++ b/.changeset/tricky-impalas-prove.md @@ -0,0 +1,5 @@ +--- +"@cube-dev/ui-kit": patch +--- + +Fix leakage of `description` prop to the trigger in Select. Add `triggerDescription` prop. diff --git a/src/components/fields/Select/Select.docs.mdx b/src/components/fields/Select/Select.docs.mdx index c355d30e7..788acd6a7 100644 --- a/src/components/fields/Select/Select.docs.mdx +++ b/src/components/fields/Select/Select.docs.mdx @@ -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`. diff --git a/src/components/fields/Select/Select.tsx b/src/components/fields/Select/Select.tsx index 9dc87356e..909670d01 100644 --- a/src/components/fields/Select/Select.tsx +++ b/src/components/fields/Select/Select.tsx @@ -182,7 +182,7 @@ export interface CubeSelectBaseProps 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; @@ -277,7 +277,7 @@ function Select( overlayStyles, suffix, message, - description, + triggerDescription, descriptionPlacement, hotkeys, direction = 'bottom', @@ -462,7 +462,7 @@ function Select( ) } - description={description} + description={triggerDescription} descriptionPlacement={descriptionPlacement} hotkeys={hotkeys} tooltip={tooltip}