Skip to content

fix(VDataTable): mobile view sort-by default to ascending#22426

Closed
prestonyford wants to merge 3 commits intovuetifyjs:masterfrom
prestonyford:fix/vdatatable-chip-sortby
Closed

fix(VDataTable): mobile view sort-by default to ascending#22426
prestonyford wants to merge 3 commits intovuetifyjs:masterfrom
prestonyford:fix/vdatatable-chip-sortby

Conversation

@prestonyford
Copy link
Copy Markdown

fixes #22288
When in mobile view of a VDataTable, makes it so clicking an option in the sort by dropdown sorts the option (instead of only adding the chip but not sorting yet)

Description

This change lets the user sort with one click, instead of two (one to create the chip, the other to click on the chip)

Markup:

<template>
  <v-app>
    <v-container>
      <v-btn @click="multiSort = !multiSort">toggle multi-sort</v-btn>
      <v-data-table :items="items" :headers="headers" :multi-sort="multiSort" mobile></v-data-table>
    </v-container>
  </v-app>
</template>

<script>
  export default {
    data(){
      return {
        items: [{a:1, b:4, c: 5}, {a:2, b:3, c:6}],
        headers: [{key: "a", title: "Col A"}, {key: "b", title: "Col B"}, {key: "c", title: "Col C"}],
        multiSort: false
      }
    }
  }
</script>

@J-Sek J-Sek changed the title fix(VTreeView): mobile view sort-by default to ascending fix(VDataTable): mobile view sort-by default to ascending Dec 10, 2025
@J-Sek J-Sek closed this in 75589cb Mar 2, 2026
J-Sek added a commit that referenced this pull request Mar 2, 2026
- use initial sort when selecting new chip(s)
- keep chips when toggling (rely on clearable to remove chip)

fixes #22288
closes #22426
J-Sek added a commit that referenced this pull request Mar 2, 2026
- use initial sort when selecting new chip(s)
- keep chips when toggling (rely on clearable to remove chip)

fixes #22288
closes #22426
mattgilbertnet pushed a commit to mattgilbertnet/vuetify that referenced this pull request Mar 2, 2026
- use initial sort when selecting new chip(s)
- keep chips when toggling (rely on clearable to remove chip)

fixes vuetifyjs#22288
closes vuetifyjs#22426
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report][3.10.8] v-data-table mobile view sort-by first selection not sorting, was working in v2

2 participants