Skip to content

Commit

Permalink
fix: add missing props for DateRangePicker (#651)
Browse files Browse the repository at this point in the history
Co-authored-by: Hunter Johnston <64506580+huntabyte@users.noreply.github.com>
  • Loading branch information
NDOY3M4N and huntabyte authored Sep 16, 2024
1 parent d3521e1 commit 7f94f45
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/unlucky-lemons-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": patch
---

fix(Date Range Picker): expose missing props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
type $$Props = Props;
export let open: $$Props["open"] = undefined;
export let onOpenChange: $$Props["onOpenChange"] = undefined;
export let portal: $$Props["portal"] = undefined;
export let value: $$Props["value"] = undefined;
export let onValueChange: $$Props["onValueChange"] = undefined;
Expand Down Expand Up @@ -34,6 +36,7 @@
const {
states: {
open: localOpen,
value: localValue,
placeholder: localPlaceholder,
isInvalid: localIsInvalid,
Expand All @@ -43,6 +46,7 @@
updateOption,
ids,
} = setCtx({
defaultOpen: open,
defaultValue: value,
defaultPlaceholder: placeholder,
preventDeselect,
Expand Down Expand Up @@ -78,6 +82,13 @@
}
return next;
},
onOpenChange: ({ next }) => {
if (open !== next) {
onOpenChange?.(next);
open = next;
}
return next;
},
});
const startFieldIds = derived(
Expand Down Expand Up @@ -199,6 +210,7 @@
localValue.set(nextValue);
}
$: placeholder !== undefined && localPlaceholder.set(placeholder);
$: open !== undefined && localOpen.set(open);
$: updateOption("disabled", disabled);
$: updateOption("isDateUnavailable", isDateUnavailable);
Expand Down

0 comments on commit 7f94f45

Please sign in to comment.