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

fix(VCalendar): continue touchMove event between days #14392

Merged

Conversation

yuwu9145
Copy link
Member

@yuwu9145 yuwu9145 commented Nov 9, 2021

fix #13174
Also keeps fixing #12366

Description

Cause: @mousemove:time touch target points to v-calendar-daily__day-interval though it is registered on v-calendar-daily__day which is underneath v-calendar-daily__day-interval

Solution: Before it was using elementFromPoint to get the top element under touch point, this fix will use document.elementsFromPoint to extract a list of elements under the touch point, then get the touch hover element based on whose event listener's callback is currently being invoked.

Motivation and Context

How Has This Been Tested?

visually

Markup:

// Paste your FULL Playground.vue here
<template>
  <v-content>
    <v-calendar 
      type="week"
      :events="events"
      @mousemove:time="move"
      @touchmove:time="move"
    />
    <v-calendar 
      type="category"
      category-show-all
      :categories="categories"          
      :events="events"
      @mousemove:time-category="move2"
      @touchmove:time-category="move2"
    />
  </v-content> 
  

</template>

<script>
export default {
  data: () => ({
    events: [],
    moveCategory: null,
    categories: ['John Smith', 'Tori Walker'],
  }),
  methods: {
    move({date, time}) {
      console.log(date, time)
      this.moveCategory = date + ', ' + time
    },
    move2({category}) {
      console.log(category)
      this.moveCategory = category
    }
  },
}
</script>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any features but makes things better)

Checklist:

  • The PR title is no longer than 64 characters.
  • The PR is submitted to the correct branch (master for bug fixes and documentation updates, dev for new features and backwards compatible changes and next for non-backwards compatible changes).
  • My code follows the code style of this project.
  • I've added relevant changes to the documentation (applies to new features and breaking changes in core library)

@KaelWD KaelWD changed the title fix(VCalendar): extract touch target based on listener is invoked fix(VCalendar): continue touchMove event between days Nov 30, 2021
@KaelWD KaelWD merged commit 10c78d2 into vuetifyjs:master Nov 30, 2021
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.

[Bug Report] VCalendar: wrong date for touchmove:time
2 participants