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

getting css/style attribute 'order' (flex boxes) fails on large numbers #3836

Closed
frudman opened this Issue Nov 2, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@frudman

frudman commented Nov 2, 2017

Description

When getting the 'order' (css style) of an element (using jquery's .css() method), the returned number is exponentialized (sp?) for larger numbers, leading to errors when that order needs to be used for computation (e.g. to move items around programmatically).

This seems to occur only for larger numbers, possibly negative numbers. All is well for smaller numbers (e.g. less than 100,000 - but I'm not sure what the actual range is that triggers the problem).

Link to test case

(extracted from actual code so maybe bigger than needs to be for this example - sorry)
http://jsbin.com/koqilag/edit?html,css,js,console

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Nov 2, 2017

Member

Thanks for opening an issue.

There's a lot of code in the test case. Please try to reduce it more in the future by inlining code, e.g. getting rid of the flexOrder method, then removing non-relevant logic & test cases etc.

In this case I was able to see what's going on there, though. We're just returning what getComputedStyle returns, see: http://jsbin.com/pazuhiz/edit?html,css,js,console

Firefox & Safari don't change the representation of the number. Could you report an issue in the Chrome bug tracker (https://crbug.com/new)? Please link to it from here. Thanks!

Member

mgol commented Nov 2, 2017

Thanks for opening an issue.

There's a lot of code in the test case. Please try to reduce it more in the future by inlining code, e.g. getting rid of the flexOrder method, then removing non-relevant logic & test cases etc.

In this case I was able to see what's going on there, though. We're just returning what getComputedStyle returns, see: http://jsbin.com/pazuhiz/edit?html,css,js,console

Firefox & Safari don't change the representation of the number. Could you report an issue in the Chrome bug tracker (https://crbug.com/new)? Please link to it from here. Thanks!

@mgol mgol added the CSS label Nov 2, 2017

@timmywil

This comment has been minimized.

Show comment
Hide comment
@timmywil

timmywil Nov 6, 2017

Member

I really don't see a use case for such a big number as a value for order. You might want to handle the problem some other way. Regardless, I don't think there's anything we can do here.

Member

timmywil commented Nov 6, 2017

I really don't see a use case for such a big number as a value for order. You might want to handle the problem some other way. Regardless, I don't think there's anything we can do here.

@timmywil timmywil closed this Nov 6, 2017

@lock lock bot locked as resolved and limited conversation to collaborators Jun 17, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.