Skip to content

Commit e5e7d1a

Browse files
committed
search: Reset search input value in the deactivate() hook
1 parent 441aca5 commit e5e7d1a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/routes/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { inject as service } from '@ember/service';
33

44
export default Route.extend({
55
fastboot: service(),
6-
search: service(),
76

87
headTags() {
98
return [
@@ -18,8 +17,6 @@ export default Route.extend({
1817
},
1918

2019
setupController(controller) {
21-
this.search.set('inputValue', null);
22-
2320
if (!controller.dataTask.hasData) {
2421
let promise = controller.dataTask.perform();
2522
if (this.fastboot.isFastBoot) {

app/routes/search.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ export default Route.extend({
2121
this.search.set('inputValue', params.q);
2222
controller.dataTask.perform(params);
2323
},
24+
25+
deactivate() {
26+
this._super(...arguments);
27+
this.search.set('inputValue', null);
28+
},
2429
});

0 commit comments

Comments
 (0)