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][2.6.0] v-data-table sortBy / sortDesc attributes are not reset correctly #14423

Closed
boris-graeff opened this issue Nov 22, 2021 · 1 comment
Assignees
Labels
C: VDataTable VDatatable T: bug Functionality that does not work as intended/expected
Milestone

Comments

@boris-graeff
Copy link

Environment

Vuetify Version: 2.6.0
Vue Version: 2.6.14
Browsers: Chrome 95.0.4638.69
OS: Linux x86_64

Steps to reproduce

Click four times on the header of the same column (eg: calories) and look at the logs :

1/ {sortBy: 'calories', sortDesc: false} => ok
2/ {sortBy: 'calories', sortDesc: true} => ok
3/
{sortBy: undefined, sortDesc: true}
{sortBy: undefined, sortDesc: undefined}
4/
{sortBy: Array(1), sortDesc: undefined}
{sortBy: Array(1), sortDesc: Array(1)}

Expected Behavior

We are expecting string/boolean couple ({sortBy: 'calories', sortDesc: false}) as multi-sort property is false

Actual Behavior

We got a array/array couple ({sortBy: Array(1), sortDesc: Array(1)})

Reproduction Link

https://codepen.io/boris-graeff/pen/NWvmmZJ?editors=101

Other comments

Not sure about what we should have in step 3 (undefined/undefined or empty string / false ?)

yuwu9145 added a commit to yuwu9145/vuetify that referenced this issue Jan 2, 2022
@KaelWD KaelWD added C: VDataTable VDatatable T: bug Functionality that does not work as intended/expected and removed S: triage labels Jan 19, 2022
@KaelWD KaelWD added this to the v2.6.x milestone Jan 19, 2022
@KaelWD KaelWD self-assigned this Jan 19, 2022
@KaelWD KaelWD closed this as completed in 9cf48e4 Jan 19, 2022
@jelle-eastground
Copy link

Since this update, I discovered that options of v-data-table initially contains the following by default:

sortBy: [],
sortDesc: [false],  // previously []

Isn't that inconsistent, as the (number of) items of sortDesc should always match the (number of) items of sortBy? At least this change introduced some bugs in my application I had to tackle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDataTable VDatatable T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants