Bug #105104
closedPreview button in page module does not focus() preview browser tab/window if same resource
100%
Description
In window-manager.js a special condition is added which checks if the browser is trying to open a URL that is already open when a user clicks the "view" button in the page layout module header.
If this is the case, a special logic path is used which reloads that other tab/window's URL - instead of calling window.open().
Unfortunately, this special logic path does NOT call focus() on the target window like the standard code path will do.
The result is that if you're clicking the "view" button but already have a window/tab open with that resource, then that other window/tab is reloaded but is not focused.
(this problem does not exist for the "view" button in the formengine edit form which uses a completely different method for opening the new window/tab).
The behavior should be consistent regardless of which "view" button is clicked and whether or not a window/tab already exists. The good UX solution appears to be that both code paths in window-manager.js should call focus() on the target window.
Code in question:
if (Utility.urlsPointToSameServerSideResource(n, l)) return i.location.replace(n), i.location.reload(), i;
Suggested replacement:
if (Utility.urlsPointToSameServerSideResource(n, l)) return i.location.replace(n), i.location.reload(), i.focus(), i;
Updated by Gerrit Code Review about 2 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86303
Updated by Gerrit Code Review about 2 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86314
Updated by Garvin Hicking about 2 months ago
Thanks! I think the patch for this is relatively straight-forward, however for me on both Chrome and Firefox on macOS, the tabs were already focussed for me. Could you tell in which browser you can reproduce this, and do you have a specific tab/window configuration for it?
Updated by Gerrit Code Review about 1 month ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86303
Updated by Gerrit Code Review about 1 month ago
Patch set 2 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86314
Updated by Gerrit Code Review 18 days ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86303
Updated by Garvin Hicking 18 days ago
@Claus Due Could you maybe check out https://review.typo3.org/c/Packages/TYPO3.CMS/+/86303 if that works for you? Thanks.
Updated by Gerrit Code Review 18 days ago
Patch set 1 for branch 13.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86869
Updated by Garvin Hicking 17 days ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b182f914d866d7208277857374a4100569b127e2.