@@ -113,6 +113,7 @@ Item {
114 visible: searchEntryEnabled
114 visible: searchEntryEnabled
115 property bool popoverShouldOpen: false
115 property bool popoverShouldOpen: false
116+ property bool popoverShouldClose: false
117 property bool narrowMode: parent.width < label.contentWidth + units.gu(50)
118 property bool narrowMode: parent.width < label.contentWidth + units.gu(50)
@@ -131,8 +132,10 @@ Item {
131 onStateChanged: {
132 onStateChanged: {
132 if (state == "active" || state == "narrowActive") {
133 if (state == "active" || state == "narrowActive") {
133 popoverShouldOpen = true;
134 popoverShouldOpen = true;
135+ popoverShouldClose = false;
135 popoverShouldOpen = false;
137 popoverShouldOpen = false;
138+ popoverShouldClose = true;
@@ -146,7 +149,8 @@ Item {
149− popoverShouldOpen = true;
152+ popoverShouldOpen = false;
153+ popoverShouldClose = false;
152 function closePopover() {
156 function closePopover() {
@@ -155,6 +159,7 @@ Item {
155 searchContainer.popover = null;
159 searchContainer.popover = null;
157 popoverShouldOpen = false;
161 popoverShouldOpen = false;
162+ popoverShouldClose = false;
160 onActiveFocusChanged: if (!activeFocus) { searchHistory.addQuery(searchField.text) }
165 onActiveFocusChanged: if (!activeFocus) { searchHistory.addQuery(searchField.text) }
@@ -302,7 +307,7 @@ Item {
303 Transition {
308 Transition {
304 to: "inactive"
309 to: "inactive"
305− ScriptAction { script: if (!searchContainer.popoverShouldOpen) { searchContainer.closePopover(); } }
310+ ScriptAction { script: if (searchContainer.popoverShouldClose) { searchContainer.closePopover(); } }
306 NumberAnimation { targets: [searchContainer, searchField] ; property: "width"; duration: 200; easing.type: Easing.InOutQuad }
311 NumberAnimation { targets: [searchContainer, searchField] ; property: "width"; duration: 200; easing.type: Easing.InOutQuad }
307 AnchorAnimation { targets: [searchContainer, textContainer]; duration: 200; easing.type: Easing.InOutQuad }
312 AnchorAnimation { targets: [searchContainer, textContainer]; duration: 200; easing.type: Easing.InOutQuad }
@@ -318,7 +323,7 @@ Item {
319 Transition {
324 Transition {
320 to: "narrowInactive"
325 to: "narrowInactive"
321− ScriptAction { script: if (!searchContainer.popoverShouldOpen) { searchContainer.closePopover(); } }
326+ ScriptAction { script: if (searchContainer.popoverShouldClose) { searchContainer.closePopover(); } }
322 NumberAnimation { targets: [searchContainer, searchField] ; property: "width"; duration: 200; easing.type: Easing.OutQuad }
327 NumberAnimation { targets: [searchContainer, searchField] ; property: "width"; duration: 200; easing.type: Easing.OutQuad }
323 AnchorAnimation { targets: [searchContainer, textContainer]; duration: 200; easing.type: Easing.InOutQuad }
328 AnchorAnimation { targets: [searchContainer, textContainer]; duration: 200; easing.type: Easing.InOutQuad }