Backoffice: CTRL+Click to open in a new tab should work on Linux (closes #21009)#21027
Backoffice: CTRL+Click to open in a new tab should work on Linux (closes #21009)#21027leekelleher merged 5 commits intomainfrom
Conversation
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-21027.westeurope.6.azurestaticapps.net |
…ot yet persisted server side (#21035) * Avoid requesting references for content that is not yet persisted server side. * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * refactor to use condition * revert * danish translations * da translation --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
…ction-uuitab-href
The router's anchor click handler incorrectly assumed non-Windows platforms use Meta (⌘) key for "open in new tab". This broke CTRL+Click on Linux, which uses CTRL like Windows. Changed detection from "is Windows" to "is Mac" so Linux correctly uses CTRL+Click while Mac continues to use Meta+Click. Also replaced deprecated navigator.platform with navigator.userAgent. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-21027.westeurope.6.azurestaticapps.net |
There was a problem hiding this comment.
Pull request overview
This PR fixes CTRL+Click not opening links in new tabs for Linux users by correcting platform detection logic in the router's anchor handler. The fix changes from Windows-based detection (which excluded Linux) to Mac-based detection, properly grouping Windows and Linux users who both use CTRL+Click.
Key changes:
- Corrected platform detection logic to use Mac detection instead of Windows detection, ensuring Linux users can CTRL+Click to open links in new tabs
- Modernized platform detection by replacing deprecated
navigator.platformwithnavigator.userAgent - Updated
<uui-tab>to use property binding for href and removed duplicate label content
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Umbraco.Web.UI.Client/src/packages/core/router/router-slot/util/anchor.ts |
Fixed platform detection logic to properly handle CTRL+Click on Linux; replaced deprecated navigator.platform with navigator.userAgent; improved code comments |
src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-header-sections.element.ts |
Changed href from attribute to property binding (.href); removed unused CSSResultGroup import; modernized styles declaration with readonly; cleaned up template by removing duplicate label text content |
.github/workflows/azure-backoffice.yml |
Added release/* branches to push and pull_request triggers, consistent with other workflow files |
|
We must remember to backport this to V16 after merge. |
Summary
Fixes CTRL+Click not opening links in new tabs on Linux (Brave, Firefox, etc.).
Closes #21009
Changes
Router anchor handler fix
The router's click handler in
anchor.tsincorrectly assumed:But Linux users also use CTRL+Click, not Meta. The fix changes the detection from "is Windows" to "is Mac", so:
Also replaced the deprecated
navigator.platformwithnavigator.userAgent.uui-tab href attribute (previous commit)
Changed
hreffrom attribute to property on<uui-tab>elements to avoid potential browser quirks with custom element attributes.Test steps
Linux (Brave/Firefox)
Mac (Safari/Chrome/Firefox)
Windows (Chrome/Edge/Firefox)
If you test on this preview environment, it should work for any link in sections and menus: https://victorious-ground-017b08103-21027.westeurope.6.azurestaticapps.net/
🤖 Generated with Claude Code