@@ -61,9 +61,7 @@ Item {
6161 unfocus();
6262 }
6363 searchTextField.text = "";
64− if (headerContainer.popover != null) {
65− PopupUtils.close(headerContainer.popover);
66− }
64+ closeSearchHistory();
6765 }
6866
6967 function unfocus() {
@@ -86,6 +84,12 @@ Item {
8684 }
8785 }
8886
87+ function closeSearchHistory() {
88+ if (headerContainer.popover != null) {
89+ PopupUtils.close(headerContainer.popover);
90+ }
91+ }
92+
8993 function refreshLogo() {
9094 if (scopeStyle ? scopeStyle.headerLogo != "" : false) {
9195 header.contents = imageComponent.createObject();
@@ -104,9 +108,7 @@ Item {
104108 anchors { fill: parent; margins: units.gu(1); bottomMargin: units.gu(3) + bottomContainer.height }
105109 visible: headerContainer.showSearch
106110 onPressed: {
107− if (headerContainer.popover) {
108− PopupUtils.close(headerContainer.popover);
109− }
111+ closeSearchHistory();
110112 if (!searchTextField.text) {
111113 headerContainer.showSearch = false;
112114 }