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(VAutocomplete): divider/subheader not rendering #15728

Closed
wants to merge 17 commits into from

Conversation

nekosaur
Copy link
Member

@nekosaur nekosaur commented Sep 1, 2022

Description

closes #15721

Motivation and Context

How Has This Been Tested?

Markup:

<template>
  <div>
    <v-select
      :items="people"
      filled
      chips
      closable-chips
      color="blue-grey-lighten-2"
      label="Select"
      multiple
    ></v-select>

    <v-autocomplete
      :items="people"
      filled
      chips
      closable-chips
      color="blue-grey-lighten-2"
      label="autocomplete"
      multiple
    ></v-autocomplete>

    <!-- <v-list :items="people" /> -->
  </div>
</template>

<script>
  const srcs = {
    1: 'https://cdn.vuetifyjs.com/images/lists/1.jpg',
    2: 'https://cdn.vuetifyjs.com/images/lists/2.jpg',
    3: 'https://cdn.vuetifyjs.com/images/lists/3.jpg',
    4: 'https://cdn.vuetifyjs.com/images/lists/4.jpg',
    5: 'https://cdn.vuetifyjs.com/images/lists/5.jpg',
  }

  export default {
    data: () => ({
      people: [
        {
          title: 'Group 1',
          subheader: true,
          divider: true,
          children: [
            { title: 'Jane Smith', group: 'Group 1', avatar: srcs[5] },
            { title: 'Britta Holt', group: 'Group 1', avatar: srcs[4] },
          ],
        },
        {
          title: 'Group 2',
          subheader: true,
          children: [
            { title: 'Trevor Hansen', group: 'Group 2', avatar: srcs[3] },
            { title: 'Ali Connors', group: 'Group 2', avatar: srcs[2] },
          ],
        },
      ],
    }),
  }
</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)

@nekosaur nekosaur added C: VSelect VSelect C: VCombobox VCombobox C: VAutocomplete VAutocomplete labels Sep 1, 2022
@nekosaur nekosaur added this to the v3.0.0-beta milestone Sep 1, 2022
@nekosaur nekosaur self-assigned this Sep 1, 2022
@KaelWD
Copy link
Member

KaelWD commented Sep 5, 2022

How about groups instead so they can be kept while filtering?

type ListItem = ({
  title?: string
  subtitle?: string
  avatar?: string
} | {
  header: string
}) & {
  divided?: boolean
  children?: ListItem[]
}

const items = [
  {
    header: 'Group 1',
    divided: true,
    children: [
      {
        title: 'Trevor Hansen',
        subtitle: 'Group 1',
      },
    ],
  },
]

@nekosaur
Copy link
Member Author

nekosaur commented Sep 16, 2022

  • type is a very bad prop name, needs to be renamed
  • I kept item type divider because I didn't want to add another itemX prop and special parsing for it

@nekosaur nekosaur marked this pull request as ready for review October 15, 2022 13:56
@paul-thebaud
Copy link
Contributor

How about groups instead so they can be kept while filtering?

Hi, I agree with @KaelWD about real groups inside v-select/autocomplete, because the current implementation is not accessibility friendly. See the group ARIA role doc.

@KaelWD KaelWD modified the milestones: v3.0.0-beta, v3.1.0 Oct 29, 2022
@volarname
Copy link
Contributor

+1 for merge

@johnleider johnleider removed the S: has merge conflicts The pending Pull Request has merge conflicts label Aug 1, 2023
@johnleider
Copy link
Member

The failed tests in this case are legitimate.

@johnleider johnleider added the S: stale This issue is untriaged and hasn't seen any activity in at least six months. label Aug 22, 2023
@johnleider johnleider marked this pull request as draft August 29, 2023 19:06
@KaelWD KaelWD force-pushed the master branch 3 times, most recently from cd170f8 to 98e57dc Compare February 14, 2024 06:14
@johnleider johnleider closed this May 13, 2024
@func0der
Copy link

This is closed without a fix getting to master or am I just blind?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VAutocomplete VAutocomplete C: VCombobox VCombobox C: VSelect VSelect S: stale This issue is untriaged and hasn't seen any activity in at least six months. T: enhancement Functionality that enhances existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report][3.0.0] v-autocomplete items header / divider not working
7 participants