From 963a2520055d0f19de936cfa156aab7b234c6803 Mon Sep 17 00:00:00 2001 From: Brad Simpson Date: Fri, 22 May 2026 13:36:14 -0600 Subject: [PATCH] Fix: only restore focus on push close when focus was inside the push (fixes #869) --- js/views/notifyPushView.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/views/notifyPushView.js b/js/views/notifyPushView.js index a3eb2798..4563b896 100644 --- a/js/views/notifyPushView.js +++ b/js/views/notifyPushView.js @@ -143,7 +143,10 @@ export default class NotifyPushView extends Backbone.View { this.$el.removeClass('is-active'); await transitionsEnded(this.$el); this.$el[0].open = false; - a11y.gotoPreviousActiveElement(); + const isFocusInPush = Boolean($(document.activeElement).closest(this.$el).length); + if (isFocusInPush) { + a11y.gotoPreviousActiveElement(); + } this.model.collection.remove(this.model); Adapt.trigger('notify:pushRemoved', this); this.model.close();