diff --git a/js/ui/main.js b/js/ui/main.js index 2d7a48019..99ea5201b 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -539,7 +539,9 @@ function pushModal(actor, params) { let prevFocusDestroyId; if (prevFocus != null) { prevFocusDestroyId = prevFocus.connect('destroy', () => { - let index = _findModal(actor); + const index = modalActorFocusStack.findIndex( + record => record.prevFocus === prevFocus); + if (index >= 0) modalActorFocusStack[index].prevFocus = null; });