Skip to content

Commit

Permalink
fix: date picker onchange
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Aug 31, 2023
1 parent efb2444 commit d65e8fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-mails-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zag-js/date-picker": patch
---

Fix issue where datepicker value onChange returned a proxy array
4 changes: 2 additions & 2 deletions packages/machines/date-picker/src/date-picker.machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,11 +672,11 @@ export function machine(userContext: UserDefinedContext) {

const invoke = {
change(ctx: MachineContext) {
const details = { value: ctx.value, view: ctx.view }
const details = { value: Array.from(ctx.value), view: ctx.view }
ctx.onChange?.(details)
},
focusChange(ctx: MachineContext) {
const details = { focusedValue: ctx.focusedValue, value: ctx.value, view: ctx.view }
const details = { focusedValue: ctx.focusedValue, value: Array.from(ctx.value), view: ctx.view }
ctx.onFocusChange?.(details)
},
viewChange(ctx: MachineContext) {
Expand Down

4 comments on commit d65e8fc

@vercel
Copy link

@vercel vercel bot commented on d65e8fc Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-vue – ./examples/vue-ts

zag-vue-git-main-chakra-ui.vercel.app
zag-vue-chakra-ui.vercel.app
zag-vue.vercel.app

@vercel
Copy link

@vercel vercel bot commented on d65e8fc Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on d65e8fc Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-nextjs – ./examples/next-ts

zag-two.vercel.app
zag-nextjs-git-main-chakra-ui.vercel.app
zag-nextjs-chakra-ui.vercel.app

@vercel
Copy link

@vercel vercel bot commented on d65e8fc Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-solid – ./examples/solid-ts

zag-solid-git-main-chakra-ui.vercel.app
zag-solid-chakra-ui.vercel.app
zag-solid.vercel.app

Please sign in to comment.