UX: Collapse advanced search on mobile when searching.

On smaller mobile devices, the height of the advanced search filters takes up
the whole real estate that it requires the user to scroll down
significantly in order to view the results.
This commit is contained in:
Guo Xiang Tan 2019-03-29 08:53:35 +08:00
parent 1a403337c9
commit c836d67cac
2 changed files with 14 additions and 0 deletions

View File

@ -315,6 +315,7 @@ export default Ember.Controller.extend({
search() {
this.set("page", 1);
this._search();
if (this.site.mobileView) this.set("expanded", false);
},
toggleAdvancedSearch() {

View File

@ -11,13 +11,26 @@ QUnit.test("search", async assert => {
exists("input.full-page-search"),
"it shows the full page search form"
);
assert.ok(!exists(".search-results .fps-topic"), "no results by default");
await click(".search-advanced-title");
assert.ok(
find(".search-advanced-filters").length === 1,
"it should expand advanced search filters"
);
await fillIn(".search-query", "posts");
await click(".search-cta");
assert.ok(find(".fps-topic").length === 1, "has one post");
assert.ok(
find(".search-advanced-filters").length === 0,
"it should collapse advanced search filters"
);
await click("#search-button");
assert.equal(