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

[Bug Report][3.1.5] props for buttons that are inside v-btn-toggle are not getting applied #16686

Closed
peshanghiwa opened this issue Feb 16, 2023 · 6 comments
Assignees
Labels
C: VBtn VBtn C: VBtnToggle VBtnToggle T: enhancement Functionality that enhances existing features

Comments

@peshanghiwa
Copy link

Environment

Vuetify Version: 3.1.5
Vue Version: 3.2.45
Browsers: Chrome 110.0.0.0
OS: Windows 10

Steps to reproduce

Copy/Paste any example of v-btn-toggle component in the official documentation of vuetify and try to add any initial props like color='primary' to the v-btn components, and they don't work and stay transparent until you click on them and make them active

<template>
  <v-app>
    <v-main>
       <v-btn-toggle>
        <v-btn color='primary'> <!-- This color prop doesn't get applied initially until button is clicked -->
          test
        </v-btn>
 	<v-btn color='black'>
          test 2
        </v-btn>
         <v-btn variant='elevated'>
          test 3
        </v-btn>
      </v-btn-toggle>
    </v-main>
  </v-app>
</template>

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

const msg = ref('Hello World!')
</script>

Expected Behavior

To have an initial styles/props applied to the buttons regardless of weather the buttons are selected or not

Actual Behavior

The buttons stay as default and do not apply any props up until they are selected

Reproduction Link

https://play.vuetifyjs.com/#...

@yuwu9145
Copy link
Member

  • When v-btn is independent, color is applied immediately
  • When v-btn is inside a group (e.g. v-btn-toggle), color is only applied when it is "activated". All buttons look the same when "unactivated".

This is the default behaviour from the framework

@peshanghiwa
Copy link
Author

@yuwu9145 Ok, but what if I initially don't want the button to be white/transparent, but rather has a primary color and on active state change the color to something else.
Basicly have both color and active-color props on the component just like some other vuetify components that have these exact props.

I believe at this I should've flagged this issue as feature request and not a bug report :(

@mayakokits
Copy link

  • When v-btn is independent, color is applied immediately
  • When v-btn is inside a group (e.g. v-btn-toggle), color is only applied when it is "activated". All buttons look the same when "unactivated".

This is the default behaviour from the framework

@yuwu9145 The problem with this default behavior is that when a component using v-btn-toggle is mounted, the toggle doesn't represent the initial state of it's v-model. That's really counter intuitive for users. When something has a default state, as a user I want to see that.

Now when I look at these text alignment examples from the documentation, here it works as I would expect it, the initial state is visible. The examples are using @vuetify/[email protected] – does this mean we can expect it to work like that in v3.2.3 ? Is the change in behavior intended? :-)

@RejownAhmed
Copy link

Why isn't this fixed yet? This is deffinitely a bug

@johnleider

This comment was marked as off-topic.

@yuwu9145
Copy link
Member

yuwu9145 commented Apr 9, 2024

Fixed in #19088, use base-color to apply inactive color

@yuwu9145 yuwu9145 closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VBtn VBtn C: VBtnToggle VBtnToggle T: enhancement Functionality that enhances existing features
Projects
None yet
Development

No branches or pull requests

6 participants