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(VBtnGroup): add direction prop #17878

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

prashantsinghb
Copy link
Contributor

fixes #17492

Description

Added direction prop (allowed values: 'horizontal' | 'vertical')

Markup:

<template>
  <v-container>
    <v-btn-toggle
      v-model="toggle"
      color="primary"
      direction="vertical"
      variant="outlined"
    >
      <v-btn icon="mdi-format-align-left"></v-btn>
      <v-btn icon="mdi-format-align-center"></v-btn>
      <v-btn icon="mdi-format-align-right"></v-btn>
      <v-btn icon="mdi-format-align-justify"></v-btn>
    </v-btn-toggle>
  </v-container>
</template>

<script>
export default {
    data: () => ({
      toggle: null,
    }),
  }
</script>
@nekosaur
Copy link
Member

The buttons are too squished in vertical mode

image

It looks like it's caused by VBtnGroup setting VBtn default height prop value to auto. Not sure why that is done @johnleider, I couldn't see a difference without it?

@prashantsinghb
Copy link
Contributor Author

prashantsinghb commented Jul 27, 2023

@nekosaur - I concur with your observation.
If the VBtn default height prop is set to auto in VBtnGroup for any specific use case, I remove it conditionally when direction prop is set to vertical. Otherwise, I can remove default height prop for VBtn from VBtnGroup to resolve your observation.

Please suggest.

export const makeVBtnGroupProps = propsFactory({
divided: Boolean,
direction: {
type: String as PropType<'horizontal' | 'vertical'>,

Choose a reason for hiding this comment

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

This might be have a better dev experience if vertical was a boolean. Spelling out props and attributes ripe for spelling bugs; thoughts?

Copy link
Contributor Author

@prashantsinghb prashantsinghb Sep 5, 2023

Choose a reason for hiding this comment

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

I see your point. But for the sake of uniformity, have implemented direction prop as utilized in VTimeline, VWindow, VSlideGroup and other Vuetify components.

Copy link
Member

Choose a reason for hiding this comment

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

This might be have a better dev experience if vertical was a boolean. Spelling out props and attributes ripe for spelling bugs; thoughts?

I'd normally agree with you but it's too far out for that type of change. With that being said, I'm not sure why we didn't make it boolean.

@3elDU
Copy link

3elDU commented Oct 28, 2023

Any progress on this?

@adrian-burlacu-software
Copy link

adrian-burlacu-software commented Mar 21, 2024

Also need this. Using this hack:

<style>
.v-btn-toggle {
  flex-direction: column;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6 participants