Return empty values last in table sorting
See original GitHub issueIs your feature request related to a problem? Please describe…
When empty data (for example an empty String ""
) is present in table rows, the sorting function presents this first when sorted in ascending order.
Describe the solution you’d like
Empty fields should be returned last.
Describe alternatives you’ve considered
As I see it, there may be a couple of ways to present the results:
- Empty fields are always returned last (both in ascending and descending order)
- Empty fields are returned last when ascending order is selected
This may also be a configurable property to pass.
Additional context
I’m aware that the empty string comes technically before “a” for instance, but presenting a lot of empty data first when sorting is bad UX.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Return empty values last in table sorting · Issue #5410 - GitHub
When empty data (for example an empty String "") is present in table rows, the sorting function presents this first when sorted in...
Read more >sql - Sorting empty values last instead of first - Stack Overflow
What happens is that when the list is being sorted, the NULL fields will be replaced by specified replacement value, in this case...
Read more >Sort Function (SortBy) - Trying to get empty cells to return ...
I have a table with around 7 headings for a simple account information table. Not all accounts have a value for each heading/field...
Read more >Where to put empty values in sorted list? - UX Stack Exchange
One of the columns accepts empty values. If I sort the list by that column ascending, the empty values should be on top...
Read more >How ORDER BY and NULL Work Together in SQL
If you use the DESC keyword in ORDER BY to sort values in descending order, you'll get NULL values at the top of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
BootstrapVue v2.0.0-rc.28 has been released.
The new
sort-null-last
now also handles the empty string case as well. setting the prop totrue
will sortnull
,undefined
, and''
last.