File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
apps/kitchen-sink/src/ensemble/screens
packages/runtime/src/widgets/Form Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ "@ensembleui/react-kitchen-sink": patch
3+ "@ensembleui/react-runtime": patch
4+ ---
5+
6+ Add option to allow clear input for dropdown
Original file line number Diff line number Diff line change @@ -869,6 +869,17 @@ View:
869869 Text:
870870 text: Here is my label 2
871871 value: 222
872+ - Dropdown:
873+ label: Ability to stop clearing selection
874+ hintText: Hint Text
875+ allowClear: ${false}
876+ styles:
877+ dropdownBorderWidth: 3px
878+ items:
879+ - label: Option 1
880+ value: 1
881+ - label: Option 2
882+ value: 2
872883 - Card:
873884 styles:
874885 maxWidth: unset
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ export interface SelectOption {
4848}
4949
5050export type DropdownProps = {
51+ allowClear?: boolean;
5152 items?: SelectOption[];
5253 /* deprecated, use onChange */
5354 onItemSelect: EnsembleAction;
@@ -302,6 +303,7 @@ const Dropdown: React.FC<DropdownProps> = (props) => {
302303 <div ref={rootRef} style={{ flex: 1, ...formItemStyles }}>
303304 <EnsembleFormItem values={values}>
304305 <Select
306+ allowClear={values?.allowClear ?? true}
305307 className={`${values?.styles?.names || ""} ${id}_input`}
306308 defaultValue={values?.value}
307309 disabled={values?.enabled === false}
You can’t perform that action at this time.
0 commit comments