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(VBtnToggle): plain variant button opacity when selected #20279

Merged

Conversation

SonTT19
Copy link
Contributor

@SonTT19 SonTT19 commented Aug 5, 2024

Description

fixes #20142

Markup:

<template>
  <v-container>
    <v-row>
      <v-col class="py-2" cols="12" sm="6">
        <p>Mandatory</p>
        <v-btn-toggle v-model="toggle_one">
          <v-btn value="eins">
            <v-icon>mdi-format-align-left</v-icon>
          </v-btn>

          <v-btn value="zwei">
            <v-icon>mdi-format-align-center</v-icon>
          </v-btn>

          <v-btn value="drei">
            <v-icon>mdi-format-align-right</v-icon>
          </v-btn>

          <v-btn value="vier">
            <v-icon>mdi-format-align-justify</v-icon>
          </v-btn>
        </v-btn-toggle>
      </v-col>

      <v-col class="py-2" cols="12" sm="6">
        <p>Mandatory</p>
        <v-btn-toggle v-model="toggle_one" variant="plain">
          <v-btn value="eins">
            <v-icon>mdi-format-align-left</v-icon>
          </v-btn>

          <v-btn value="zwei">
            <v-icon>mdi-format-align-center</v-icon>
          </v-btn>

          <v-btn value="drei">
            <v-icon>mdi-format-align-right</v-icon>
          </v-btn>

          <v-btn value="vier">
            <v-icon>mdi-format-align-justify</v-icon>
          </v-btn>
        </v-btn-toggle>
      </v-col>
    </v-row>
  </v-container>
</template>

<script setup>
  import { ref } from 'vue'

  const toggle_one = ref('vier')
</script>

Copy link
Member

@yuwu9145 yuwu9145 left a comment

Choose a reason for hiding this comment

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

The active state for plain variant should increase opacity & change colour

Adding back overlay background looks the same as "text" variant

          @include tools.active-states('> .v-btn__overlay', $btn-toggle-selected-opacity)

       &.v-btn--variant-plain
-        > .v-btn__overlay
-          display: block
+        opacity: 1

@SonTT19
Copy link
Contributor Author

SonTT19 commented Aug 8, 2024

The active state for plain variant should increase opacity & change colour

Adding back overlay background looks the same as "text" variant

          @include tools.active-states('> .v-btn__overlay', $btn-toggle-selected-opacity)

       &.v-btn--variant-plain
-        > .v-btn__overlay
-          display: block
+        opacity: 1

I don't think we should remove the line display: block, cause it would not show the selected one

@KaelWD KaelWD force-pushed the master branch 2 times, most recently from e20cfec to 2766105 Compare August 15, 2024 09:17
@yuwu9145 yuwu9145 added this to the v3.7.x milestone Aug 21, 2024
@yuwu9145 yuwu9145 added T: bug Functionality that does not work as intended/expected C: VBtnToggle VBtnToggle labels Aug 21, 2024
@KaelWD KaelWD force-pushed the master branch 3 times, most recently from 4c970f9 to 6a3285f Compare September 3, 2024 18:11
@KaelWD KaelWD changed the title fix(VBtnToggle): fix display selected button with plain variant fix(VBtnToggle): plain variant button opacity when selected Nov 3, 2024
@KaelWD KaelWD merged commit bfe6310 into master Nov 3, 2024
18 checks passed
@KaelWD KaelWD deleted the fix/20142-v-btn-toggle-selected-value-with-plain-variant branch November 3, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VBtnToggle VBtnToggle 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.6.12] v-btn-toggle in variant="plain" does not show default value as selected
3 participants