Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#170904455
After pressing "Filter" on the responses filter, empty strings are added to the
with_state
andwith_survey
arrays. This doesn't affectwith_survey
, however if no state is selected after pressing "Filter", the array of states is[""]
. This makes it sofilterrific.with_state.length > 0
evaluate totrue
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 thewith_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 addingautocomplete: "off"
to all of the filter dropdowns so that the dropdown states would not be cached by the browser.