primefaces / primevue

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

Column: Sorting does not work for mix of Strings and Numbers #4137

Open Unstriped opened 1 year ago

Unstriped commented 1 year ago

Describe the bug

When having a dataset with a mix of Strings and Numbers the columns does not sort the column properly. Any Number element that is after to a String element will not be sorted.

A workaround is to convert all numbers to strings.

Reproducer

https://codesandbox.io/s/primevue-demo-forked-nw2fzj?file=/src/App.vue

PrimeVue version

3.30.0

Vue version

3.x

Language

ALL

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

Go to the codesandbox link and sort by quantity. Notice how 24 remains at the top no matter how it is sorted.

Expected behavior

Expected result is for the column to be numerically sorted with the string either at the top or bottom.

alpiua commented 5 months ago

Not sure if it is related, but I just found that I can't sort any other column with text field, if I have column with Date active.