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

rangeSlider widget value round issue on Safari #1254

Closed
semanticdreamer opened this issue Sep 2, 2016 · 7 comments
Closed

rangeSlider widget value round issue on Safari #1254

semanticdreamer opened this issue Sep 2, 2016 · 7 comments
Assignees

Comments

@semanticdreamer
Copy link

First things first: THX a ton for all your awesome work w/ instantsearch.js 👍

Seems there is an issue w/ the rangeSliderwidget - only on Safari, so far tested on OS X only.

To reproduce: https://community.algolia.com/instantsearch.js/documentation/#rangeslider

@bobylito
Copy link
Contributor

bobylito commented Sep 2, 2016

Isn't that related to the underlying implementation @vvo ?

@vvo vvo added the Type: Bug label Sep 2, 2016
@vvo vvo self-assigned this Sep 2, 2016
vvo pushed a commit that referenced this issue Sep 2, 2016
The default rounding strategy for pips in nouislider is to use
Math.round().

We used Number(v).toLocaleString() but on safari this led to weird
results because 10.100001.toLocaleString() => '10.1000001' and on
chrome it's  '10' for example.

Thus now we will Math.round the number before passing it to
toLocaleString only if the step parameter of the slider is an integer.

We use an npm module for Number.isInteger() because no IE nor safari
version has it.

fixes #1254
@vvo vvo closed this as completed in b993033 Sep 2, 2016
@vvo
Copy link
Contributor

vvo commented Sep 2, 2016

This will be released on monday

@semanticdreamer
Copy link
Author

Wow, THAT was fast. THX @vvo 👍

vvo pushed a commit that referenced this issue Sep 6, 2016
<a name="1.8.5"></a>
## [1.8.5](v1.8.4...v1.8.5) (2016-09-06)

### Bug Fixes

* **deps:** upgrade all deps 2016-09-05 (#1261) ([408d597](408d597))
* **rangeSlider:** round pips numbers when step is integer (#1255) ([b993033](b993033)), closes [#1254](#1254)
@JanPetr
Copy link
Contributor

JanPetr commented Sep 12, 2016

@vvo I'm still experiencing the issue on Magento demo:
screenshot 2016-09-12 18 07 28

I'm using the latest version of IS with algoliaBundle, built today. Reopen?

@vvo
Copy link
Contributor

vvo commented Sep 12, 2016

@JanPetr Magento 1 or 2? Can you provide steps to reproduce the issue, I can use the developement environement of magento 1

@JanPetr
Copy link
Contributor

JanPetr commented Sep 12, 2016

Magento 1, go to https://magento.algolia.com/women/tops-blouses.html and play a bit with slider's left handle. Cannot reproduce reliably, usually it happens around value 200, but only from time to time :(
Google Chrome 52.0.2743.116, MacBook Pro

vvo pushed a commit that referenced this issue Sep 13, 2016
There was currently no precision formatting within the Slider.

While sometime the computed interpolated value for the slider would be
23.0000003 we would refine Algolia with that and this would end up
showing in other widgets.

So we default to precision 2 within all number formatting within the
slider by default.

fixes
#1254 (comment)
and linked to https://github.com/algolia/algoliasearch-
magento/issues/546
vvo added a commit that referenced this issue Sep 14, 2016
* chore(build): force rebuild, was lost because bad travis config

* fix(Slider): default precision to 2

There was currently no precision formatting within the Slider.

While sometime the computed interpolated value for the slider would be
23.0000003 we would refine Algolia with that and this would end up
showing in other widgets.

So we default to precision 2 within all number formatting within the
slider by default.

fixes
#1254 (comment)
and linked to https://github.com/algolia/algoliasearch-
magento/issues/546
@vvo
Copy link
Contributor

vvo commented Sep 14, 2016

Released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants