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(VHover): false isHovering by default #19623

Merged
merged 3 commits into from May 1, 2024

Conversation

vkrms
Copy link
Contributor

@vkrms vkrms commented Apr 17, 2024

Description

fixes #19601

Markup:

<template>
  <v-app>
    <v-container>
      <v-hover>
        <template #default="{ isHovering, props }">
          <v-badge :model-value="isHovering" content="visible on hover">
            <v-chip :label="true" class="mr-1" size="small" v-bind="props">
              {{ isHovering }}
              <span class="font-weight-bold"> Hover Over Me </span>
            </v-chip>
          </v-badge>
        </template>
      </v-hover>
    </v-container>
  </v-app>
</template>

@johnleider
Copy link
Member

From @KaelWD's comment, should this be null as default?

#19601 (comment)

@johnleider johnleider added C: VHover T: bug Functionality that does not work as intended/expected labels Apr 22, 2024
@johnleider johnleider added this to the v3.5.x milestone Apr 22, 2024
@vkrms vkrms force-pushed the fix/19601-v-hover branch 2 times, most recently from 3b0f775 to 90f1ba3 Compare April 24, 2024 02:43
@vkrms
Copy link
Contributor Author

vkrms commented Apr 24, 2024

From @KaelWD's comment, should this be null as default?

#19601 (comment)

Yeah I guess it should work better if someone wants to check for an element being untouched. I've introduced the fix, please check.

@@ -7,7 +7,7 @@ import { genericComponent, propsFactory } from '@/util'

type VHoverSlots = {
default: {
isHovering: boolean | undefined
isHovering: boolean
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this be boolean | null?

@johnleider johnleider modified the milestones: v3.5.x, v3.6.x Apr 30, 2024
@vkrms
Copy link
Contributor Author

vkrms commented May 1, 2024

@KaelWD Yeah you're right. I had to mess with other components to make typescript happy. Please review.
I'm not sure the failing cypress test has anything to do with the fix. I'm diggin into it but it does not make any sense at the moment.

@johnleider johnleider merged commit 75ed37b into vuetifyjs:master May 1, 2024
10 checks passed
modelValue: {
type: Boolean as PropType<boolean | null>,
default: null,
},
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops things got a bit out of hand there. This cast should be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VHover T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report][3.5.15] v-hover isHovering is undefined
3 participants