Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Datepicker legacy vue3 support (#112) #147

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

kikuomax
Copy link
Collaborator

Fixes #

Proposed Changes

  • Modify DatepickerTableRow and DatepickerMonth so that they work both with Vue v3.2.24 or earlier, and Vue v3.2.25 or later
    • ref combined with v-for is stored as a single object in $refs on Vue v3.2.24 or earlier, but stored in an array on Vue v3.2.25 or later
  • Add test cases that test affected behavior

- Adds test cases:
    1. Tests if `DatepickerTableRow` calls `focus` on the corresponding
       date cell when `day` is updated
    2. Tests if `DatepickerMont` calls `focus` on the corresponding date
       cell when `focusedMonth` is updated

  These tests are intended to make sure `Datepicker` works both with Vue
  before 3.2.25, and Vue 3.2.25 or later.
- Fixes the following bugs:
    - `DatepickerTableRow` did not call `focus` on the corresponding
      date cell when `day` is updated
    - `DatepickerMonth` did not call `focus` on the corresponding month
      cell when `focusedMonth` is updated

  The bugs were caused due to the change in Vue's behavior from v3.2.24
  to v3.2.25; `ref`s in v-for are stored as a single object in v3.2.24
  or earlier, but in an array in v3.2.25 or later.

  The fixed code works both with Vue v3.2.24 or earlier, and v3.2.25 or
  later.
@kikuomax kikuomax requested a review from wesdevpro November 24, 2023 01:58
@kikuomax kikuomax merged commit 48571f0 into ntohq:dev Nov 27, 2023
3 checks passed
@kikuomax kikuomax deleted the datepicker-legacy-vue3-support branch November 27, 2023 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants