-
-
Notifications
You must be signed in to change notification settings - Fork 96
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(BTable): Enable more sorting options to get closer to BSV parity #1771
Conversation
Run & review this pull request in StackBlitz Codeflow. |
) | ||
}) | ||
return sortDescBoolean.value && props.sortCompare === undefined ? sorted.reverse() : sorted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this functionality still is working in return ( realVal(a).localeCompare(realVal(b), props.sortCompareLocale, props.sortCompareOptions) * (sortDescBoolean.value ? -1 : 1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - we had a case "conflicting" PRs that solved the same problem in ways that didn't actually cause a conflict in the diffs. My unit tests caught this. I left the way that I solved it in, as I think it's slightly cleaner (but I'm not a native JS developer, so if you'd prefer doing the explicit reverse at the end rather than sorting in the correct direction in the first place, I'll swap it out.
Describe the PR
There were a few issues with table sorting compared to BSV:
I also added tests to cover these cases and updated the type documentation.
Small replication
Any sorted table example will replicate these issues. See the tests in this PR for concrete examples.
PR checklist
What kind of change does this PR introduce? (check at least one)
fix(...)
feat(...)
fix(...)
docs(...)
The PR fulfills these requirements:
CHANGELOG
is generated from these messages, and determines the next version type. Pull requests that do not follow conventional commits or do not have an override will be denied