question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Return empty values last in table sorting

See original GitHub issue

Is 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:

  1. Empty fields are always returned last (both in ascending and descending order)
  2. 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:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tmorehousecommented, Aug 12, 2019

BootstrapVue v2.0.0-rc.28 has been released.

1reaction
tmorehousecommented, Aug 7, 2019

The new sort-null-last now also handles the empty string case as well. setting the prop to true will sort null, undefined, and '' last.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found