Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Stats component is not always display #330

Closed
samouss opened this issue Oct 17, 2017 · 3 comments
Closed

Stats component is not always display #330

samouss opened this issue Oct 17, 2017 · 3 comments
Labels

Comments

@samouss
Copy link
Contributor

samouss commented Oct 17, 2017

Do you want to request a feature or report a bug?
Bug

Bug: What is the current behavior?

The Stats component is not always visible even if the totalResults is greater than 0.

  • on initial load the Stats component is not visible ('10,000' > 0 => false)
  • search for He
  • it will be now visible ('444' > 0 => true)

https://codepen.io/anon/pen/BwGGwE?editors=1010#0

Bug: What is the expected behavior?

The Stats component should always be visible when totalResults is greater than 0.

Bug: What browsers are impacted? Which versions?

All.

Bug: What is the proposed solution?

The totalResults computed property pass to the view is converted to a string with toLocaleString(). So the condition for display the content is not always predictable.

We should pass two variables to the view, one for the display the count and the other for the condition.

What is the version you are using? Always use the latest one before opening a bug issue.

1.2.0

@rayrutjes
Copy link
Member

Thanks for reporting this @samouss will fix it in the hour.

@rayrutjes
Copy link
Member

Looks like we went a little bit to fast @ehayman 😂

@rayrutjes
Copy link
Member

rayrutjes commented Oct 17, 2017

This is now fixed in 1.2.1 🎉
Thanks again @samouss

Haroenv pushed a commit to algolia/instantsearch that referenced this issue Dec 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants