Closed techieshark closed 7 years ago
@techieshark re the second change - is element clearing reliant on using the 'new search' button? That's how it's acting. I thought part of the issue was users scrolling and not using the button.
@Lilith-Palmer yeah it doesn't make sense to remove things from the screen simply because someone scrolled up, so we don't remove UI elements on scroll (just on clicking button).
@techieshark ok no worries - didn't realize the original address entry would be hidden upon name search.
To clarify - the behavior of the tool is different, depending on whether a user:
This is to match user expectations. Use of the new search button hides the users address details from the original search. This is consistent with user expectations of a cleared or reloaded state.
When a user scrolls, the address details remain - as expected when no reload/refresh has been undertaken.
@Rustuma and myself have tested this commit - both happy for it to merge
woo! thanks for testing! merging.
fixes #264
this commit is result of
git cherry-pick 5fbeefc8040a8a45f22a87ea6668c8bcd55f5ba0
and merge + extend by Peter W. Original commit was: "fixes/264-If user scrolls back to top to start a new search, results are inconsistent" by Peter O.Notable changes:
'Scroll to top' button is now 'New search' (again)
During scroll to top, app state is reset and corresponding UI elements are reset (aka hidden or emptied)
app.ui.scrollAndCenter() now takes a callback (optional) to run after scrolling (this gets used by the reset code so we can scroll past things and then remove them).
Map control for nearby schools filter now makes sure to update the feature associated with a given school level (primary or secondary) - previously those radio buttons weren't getting reset in some cases. A bunch of 'fieldset.appendChild(...' lines changed because we needed a way to select the buttons associated with the school level, so the secondary buttons now match the primary in that they have a 'feature-secondary' name we can select by in updateFeaturesUI().
new methods: app.resetState() -- was in Peter O's code too. app.ui.clearSearchInputs() app.ui.reset() app.listView.hide(); // each of these .hide() methods are used in ui.reset() app.mapView.hide(); app.schoolView.hide(); (and we added $el.show() to compensate in *View.render())