@@ -120,7 +120,14 @@ FocusScope {
120120 }
121121 return;
122122 }
123− switchToNextState("")
123+ if (root.lockedVisible) {
124+ // Due to binding updates when switching between modes
125+ // it could happen that our request to show will be overwritten
126+ // with a hide request. Rewrite it when we know hiding is not allowed.
127+ switchToNextState("visible")
128+ } else {
129+ switchToNextState("")
130+ }
124131 }
125132
126133 function fadeOut() {
@@ -258,13 +265,6 @@ FocusScope {
258265 interval: 1
259266 property string nextState: ""
260267 onTriggered: {
261− if (root.lockedVisible && nextState == "") {
262− // Due to binding updates when switching between modes
263− // it could happen that our request to show will be overwritten
264− // with a hide request. Rewrite it when we know hiding is not allowed.
265− nextState = "visible"
266− }
267−
268268 // switching to an intermediate state here to make sure all the
269269 // values are restored, even if we were already in the target state
270270 root.state = "tmp"
@@ -383,8 +383,7 @@ FocusScope {
383383 }
384384
385385 Keys.onEscapePressed: {
386− switchToNextState("");
387− root.focus = false;
386+ root.hide()
388387 }
389388
390389 onDragDistanceChanged: {