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

feat(VSnackbar): keep snackbar open while mouseover #12599

Merged
merged 7 commits into from
Nov 16, 2020

Conversation

jacekkarczmarczyk
Copy link
Member

@jacekkarczmarczyk jacekkarczmarczyk commented Nov 12, 2020

Description

Adds hold-on-hover prop that stops the timer on mouseenter and restarts on mouseleave

Motivation and Context

fixes #12494

How Has This Been Tested?

playground

Markup:

<template>
  <v-container>
    <v-btn @click="snackbar1 = true">Show snackbar 1</v-btn>
    <v-btn @click="snackbar2 = true">Show snackbar 2</v-btn>
    <v-snackbar
      v-model="snackbar1"
      hold-on-hover
      timeout="2000"
      color="success"
    >Hover me and I won't dissapear</v-snackbar>
    <v-snackbar
      v-model="snackbar2"
      timeout="2000"
      color="error"
    >Hover me and I will dissapear</v-snackbar>
  </v-container>
</template>

<script>
  export default {
    data: () => ({
      snackbar1: false,
      snackbar2: false,
    }),
  }
</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)

@jacekkarczmarczyk jacekkarczmarczyk added T: feature A new feature C: VSnackbar VSnackbar labels Nov 12, 2020
@jacekkarczmarczyk jacekkarczmarczyk added this to the v2.4.0 milestone Nov 12, 2020
@jacekkarczmarczyk jacekkarczmarczyk self-assigned this Nov 12, 2020
Co-authored-by: Albert Kaaman <albert@kaaman.nu>
nekosaur
nekosaur previously approved these changes Nov 12, 2020
@KaelWD
Copy link
Member

KaelWD commented Nov 13, 2020

Any reason this shouldn't just be the default behaviour instead of a prop?

Co-authored-by: Kael <kaelwd@gmail.com>
@jacekkarczmarczyk
Copy link
Member Author

I was thinking that it could be a breaking change and we could make it default behaviour in 3.x

@KaelWD
Copy link
Member

KaelWD commented Nov 13, 2020

I don't think it counts as a breaking change.

@jacekkarczmarczyk
Copy link
Member Author

I'm ok with that, do we need a prop to switch this behaviour off?

@KaelWD KaelWD changed the title feat(VSnackbar): hold-on-hover prop feat(VSnackbar): stop timeout when hovering snackbar Nov 16, 2020
@KaelWD KaelWD changed the title feat(VSnackbar): stop timeout when hovering snackbar feat(VSnackbar): keep snackbar open while mouseover Nov 16, 2020
@KaelWD KaelWD merged commit 8808d98 into dev Nov 16, 2020
@KaelWD KaelWD deleted the feat/#12494-snackbar-hold-on-hover-prop branch November 16, 2020 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VSnackbar VSnackbar T: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Keep v-snackbar open if mouseover
3 participants