primefaces / primevue

Next Generation Vue UI Component Library
https://primevue.org
MIT License
10.85k stars 1.24k forks source link

DataTable: nullSortOrder 1 not working properly when changing sort order of a column #6726

Closed hstupkova closed 1 week ago

hstupkova commented 3 weeks ago

Describe the bug

If the nullSortOrder is set to 1, the null and undefined values are always sorted at the end of the table regardless of the sort order of the column. In comparison, if the nullSortOrder is set to -1, the null and undefined values are sorted at the end of the table (descending order) or the begining of the table (ascending order).

Reproducer

https://stackblitz.com/edit/primevue-3-vite-issue-template-f9icko?file=src%2FApp.vue

PrimeVue version

3.47.2

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

  1. Go to stackblitz.
  2. Click repeatedly the Date column to change sort order (ascending/descending).
  3. Compare how nullSortOrder 1 (first table) and nullSortOrder -1 (second table) behaves. The data is the same.

Expected behavior

If the nullSortOrder is set to 1, the null values are sorted at the end of the table (ascending order) or the begining (descending order).

tugcekucukoglu commented 1 week ago

This is expected behaviour. Thank you.

If you encounter any other problem, please let us know.