Gapminder / dollar-street-pages

Dollar Street public pages
https://www.gapminder.org/dollar-street/
GNU General Public License v3.0
14 stars 23 forks source link

sliders lock when results out of range #1221

Open paul-ooi opened 6 years ago

paul-ooi commented 6 years ago

Context

When the results are outside of the pre-selected slider range, the slider controls get locked, and cannot be moved to another range that currently contains valid results from the query. This doesn't seem to happen with other topics, so I believe the solution already exists in the code.

Steps to reproduce

  1. User selects a range from the poorest to just below $200 out of the whole World, initial filter topic should not be Alcoholic Drinks (Upper range needs to be under whichever the lowest result is for the Alcoholic Drinks result)
  2. User then selects from the topics to filter by "Alcoholic Drinks"
  3. User deletes and it's lost forever

Expected result

If there are no results in the range the user pre-selected, allow the sliders to be moved to a range that has valid results (this is already functional for the other topics I've tried)

Current result

When you select an item from the topics to filter by (I tried Alcoholic Drinks), but there's zero results in the range that is selected with the sliders (I selected the poorer end of the scale). Although the warning "Sorry, we have no alcoholic drinks on this income yet" pops up, the sliders are locked and can't be adjusted to the area that actually has results.

Possible Fix

[not obligatory, but suggest fixes or reasons for the bug]

Platform

Browsers

Chrome, Firefox, Edge, Opera

sliders lock when results out of range screenshot

image