Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(DatePicker): error when unselecting a date #1619

Merged
merged 3 commits into from
Feb 14, 2025

Conversation

hartbit
Copy link
Contributor

@hartbit hartbit commented Feb 13, 2025

This resolves #1618.

Again, I failed to reproduce the issue in unit tests. I tried this, unsuccessfully:

  it('does not throw when selecting the same date twice', async () => {
    const { user, trigger, getByTestId, rerender } = setup({
      datePickerProps: { modelValue: calendarDate },
      emits: { 'onUpdate:modelValue': (data: DateValue) => rerender({ modelValue: data }) },
    })

    await user.click(trigger)
    const selectedDay = getByTestId('calendar').querySelector<HTMLElement>('[data-selected]')!
    await user.click(selectedDay)
  })

@zernonia
Copy link
Member

Thanks for the @hartbit ! Yeah the unit test can be abit tricky sometimes 🙈

@zernonia zernonia merged commit d3e98e9 into unovue:main Feb 14, 2025
3 checks passed
Copy link

pkg-pr-new bot commented Feb 14, 2025

Open in Stackblitz

npm i https://pkg.pr.new/radix-vue@1619

commit: 440eae4

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: DatePicker - Selecting the same date twice in a row causes an unhandled error
2 participants