Skip to content

Commit 7a85f36

Browse files
authored
Merge pull request #1075 from nextcloud/backport/1073/stable28
[stable28] fix: Fix focus lost to body when closing firstrunwizard
2 parents 5d266b7 + 7f4a080 commit 7a85f36

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

js/about.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ document.addEventListener('DOMContentLoaded', function() {
88
event.stopPropagation();
99
event.preventDefault();
1010
OCP.Loader.loadScript('firstrunwizard', 'firstrunwizard-main.js').then(function () {
11-
OCA.FirstRunWizard.open();
11+
OCA.FirstRunWizard.open({
12+
setReturnFocus: document.querySelector('[aria-controls="header-menu-user-menu"]') ?? undefined,
13+
});
1214
OC.hideMenus(function () {
1315
return false;
1416
});

js/firstrunwizard-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/firstrunwizard-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
size="normal"
2929
:has-next="hasNext"
3030
:has-previous="hasPrevious"
31+
:set-return-focus="setReturnFocus"
3132
@close="close"
3233
@next="goToNextPage"
3334
@previous="goToPreviousPage">
@@ -110,6 +111,7 @@ export default {
110111
logoURL: imagePath('firstrunwizard', 'nextcloudLogo.svg'),
111112
pageSlideDirection: undefined,
112113
circleSlideDirection: undefined,
114+
setReturnFocus: undefined,
113115
}
114116
},
115117
@@ -147,14 +149,18 @@ export default {
147149
},
148150
149151
methods: {
150-
open() {
152+
open({ setReturnFocus }) {
153+
if (setReturnFocus) {
154+
this.setReturnFocus = setReturnFocus
155+
}
151156
this.page = 0
152157
this.showModal = true
153158
},
154159
155160
close() {
156161
this.page = 0
157162
this.showModal = false
163+
this.setReturnFocus = undefined
158164
axios.delete(generateUrl('/apps/firstrunwizard/wizard'))
159165
},
160166

0 commit comments

Comments
 (0)