diff --git a/src/components/input-elements/DatePicker/DatePicker.tsx b/src/components/input-elements/DatePicker/DatePicker.tsx index d63c08617..965f6b8df 100644 --- a/src/components/input-elements/DatePicker/DatePicker.tsx +++ b/src/components/input-elements/DatePicker/DatePicker.tsx @@ -151,6 +151,7 @@ const DatePicker = React.forwardRef((props, ref ) : null} ((props, ref (( ) : null} (( focus={true} className={tremorTwMerge( // common - "absolute z-10 divide-y overflow-y-auto min-w-min left-0 outline-none rounded-tremor-default p-3", + "divide-y overflow-y-auto outline-none rounded-tremor-default p-3", // light "bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown", // dark @@ -329,6 +330,7 @@ const DateRangePicker = React.forwardRef(( {value ? valueToNameMapping.get(value) ?? selectPlaceholder : selectPlaceholder} (( ((props, r ) : null} ((props, r ((props, ) : null} {filteredOptions.length > 0 && ( ((props, ((props, ref) => { ) : null} ((props, ref) => { (args.value!); return (
+ setValue(v)} /> setValue(v)} /> - -

value: {value}

- + + +

value: {value.join(", ")}

+
); }; + +export default SimpleMultiSelectControlled; diff --git a/src/stories/input-elements/helpers/SimpleSearchSelect.tsx b/src/stories/input-elements/helpers/SimpleSearchSelect.tsx index 487447873..62950caa7 100644 --- a/src/stories/input-elements/helpers/SimpleSearchSelect.tsx +++ b/src/stories/input-elements/helpers/SimpleSearchSelect.tsx @@ -19,6 +19,20 @@ export const SimpleSearchSelectControlled = (args: any) => { const [value, setValue] = React.useState("5"); return (
+ { + setValue(value); + alert(value); + }} + {...args} + > + Five + Three + One + Thirty + Thirtythree + { diff --git a/src/stories/input-elements/helpers/SimpleSelect.tsx b/src/stories/input-elements/helpers/SimpleSelect.tsx index 24f4abb34..18bed300a 100644 --- a/src/stories/input-elements/helpers/SimpleSelect.tsx +++ b/src/stories/input-elements/helpers/SimpleSelect.tsx @@ -17,32 +17,51 @@ export const SimpleSelect = (args: any) => ( ); -export const SimpleSelectControlled = (args: any) => { - const [value, setValue] = React.useState("5"); +export function SimpleSelectControlled() { + const [value, setValue] = React.useState("5"); + + const handleValueChange = (newValue: string) => { + setValue(newValue); + alert(newValue); + }; + + const handleReset = () => { + setValue(""); + }; + + const handleSetToOne = () => { + setValue("1"); + }; + return (
- + One + Two + Three + Four + Five + Six + Seven + Eight + Nine + Ten + + - - + +

value: {value}

); -}; +}