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(VNavigationDrawer): always bind mouseover events #14523

Merged
merged 1 commit into from Dec 23, 2021

Conversation

johnleider
Copy link
Member

@johnleider johnleider commented Dec 16, 2021

Description

Updated v-navigation-drawer to use its real width for application layout calculations. As a consequence to this change, a bug with expand-on-hover and listeners was resolved.

Motivation and Context

fixes #13309

How Has This Been Tested?

visually

Markup:

<template>
  <div>
    <v-navigation-drawer
      v-model="drawer"
      :mini-variant="mini"
      :expand-on-hover="mini"
      app
    >
      <v-list-item class="px-2">
        <v-list-item-avatar>
          <v-img src="https://randomuser.me/api/portraits/men/85.jpg"></v-img>
        </v-list-item-avatar>

        <v-list-item-title>John Leider</v-list-item-title>

        <v-btn
          icon
          @click="mini = !mini"
        >
          <v-icon v-show="mini">mdi-plus</v-icon>
          <v-icon v-show="!mini">mdi-minus</v-icon>
        </v-btn>
      </v-list-item>
    </v-navigation-drawer>
    <v-main app>
      <div class="pa-8">
        <p>Content</p>
        <v-switch
          v-model="mini"
          label="Is Mini"
        />
      </div>
    </v-main>
  </div>
</template>

<script>
  export default {
    data () {
      return {
        drawer: true,
        items: [
          { title: 'Home', icon: 'mdi-home-city' },
          { title: 'My Account', icon: 'mdi-account' },
          { title: 'Users', icon: 'mdi-account-group-outline' },
        ],
        mini: true,
      }
    },

  }
</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)

@johnleider johnleider added T: bug Functionality that does not work as intended/expected C: VNavigationDrawer VNavigationDrawer labels Dec 16, 2021
@johnleider johnleider added this to the v2.6.x milestone Dec 16, 2021
@johnleider johnleider self-assigned this Dec 16, 2021
@KaelWD KaelWD changed the title fix(VNavigationDrawer): update layout with real width fix(VNavigationDrawer): always bind mouseover events Dec 20, 2021
@KaelWD KaelWD merged commit 03e683f into master Dec 23, 2021
@KaelWD KaelWD deleted the fix/13309-navigation-drawer branch December 23, 2021 12:50
Comment on lines +354 to +355
mouseenter: () => (this.isMouseover = true),
mouseleave: () => (this.isMouseover = false),
Copy link

Choose a reason for hiding this comment

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

Is it possible that these two lines should be added only if (this.expandOnHover), like it was before?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VNavigationDrawer VNavigationDrawer 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][2.4.7] Navigation Drawer - expand-on-hover, mini-variant and v-main width
4 participants