Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] data-order not working with negative numbers #392

Closed
2 tasks done
Stoakes opened this issue Aug 21, 2024 · 1 comment
Closed
2 tasks done

[BUG] data-order not working with negative numbers #392

Stoakes opened this issue Aug 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Stoakes
Copy link

Stoakes commented Aug 21, 2024

  • I have looked through the documentation to try to see if this behavior is documented.
  • I have looked at the demos to see if one of them handles this, but none of them did.

Describe the bug
Hello, thanks a lot for this library !

I think I found a bug : when setting the data-order attribute on cells and using negative values, the ordering doesn't work as expected.

To Reproduce

I have created this jsfiddle to demonstrate the issue : https://jsfiddle.net/6Lpjnqrk/

Steps to reproduce the behavior:

  1. Go to https://jsfiddle.net/6Lpjnqrk/
  2. Click on Variation header to sort the column (asc or desc, doesn't matter)
  3. The rows are not ordered according to data-order value. Negative values are not taken into account. Even if it was sorted based on string value, that wouldn't look like that.
Name Variation (ordered by asc)
MSFT 0.0%
FB 0.4%
AAPL -0.5%
PG -0.41%
NVIDIA 1.6%

Expected behavior
Values should be ordered according to data-order value :

Name Variation (asc)
AAPL -0.5%
PG -0.41%
MSFT 0.0%
FB 0.4%
NVIDIA 1.6%

Additional context
This doesn't seem to be an issue related to floats. It behaves the same when using integers in data-order.

Have a good day

@Stoakes Stoakes added the bug Something isn't working label Aug 21, 2024
@Stoakes
Copy link
Author

Stoakes commented Aug 21, 2024

Thanks for taking care of this one so fast.

I confirm it's now working as intended with negative numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant