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

SAW - SPARCForms Filter Bug #2246

Merged
merged 2 commits into from Mar 13, 2020
Merged

SAW - SPARCForms Filter Bug #2246

merged 2 commits into from Mar 13, 2020

Conversation

SamWord
Copy link
Contributor

@SamWord SamWord commented Mar 10, 2020

#170904455

After pressing "Filter" on the responses filter, empty strings are added to the with_state and with_survey arrays. This doesn't affect with_survey, however if no state is selected after pressing "Filter", the array of states is [""]. This makes it so filterrific.with_state.length > 0 evaluate to true for all options in determining which options should be disabled. Since the survey dropdown is set to hide disabled options, there appeared to be no surveys to filter. This was fixed by rejecting blank elements in the with_state array.

Additionally, sometimes browsers will cache the select tag states and ignore which options are meant to be selected. This was confusing because it would appear as though no survey state was selected, even though filterrific.with_state included a state, and the following survey dropdown would only show surveys with that state (see second screenshot in the story). This was fixed by adding autocomplete: "off" to all of the filter dropdowns so that the dropdown states would not be cached by the browser.

@Stuart-Johnson Stuart-Johnson merged commit e79a424 into v3.7.0 Mar 13, 2020
@Stuart-Johnson Stuart-Johnson deleted the saw-filter-bug branch March 13, 2020 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants