Skip to content

Backoffice: CTRL+Click to open in a new tab should work on Linux (closes #21009)#21027

Merged
leekelleher merged 5 commits intomainfrom
v17/hotfix/section-uuitab-href
Dec 3, 2025
Merged

Backoffice: CTRL+Click to open in a new tab should work on Linux (closes #21009)#21027
leekelleher merged 5 commits intomainfrom
v17/hotfix/section-uuitab-href

Conversation

@iOvergaard
Copy link
Contributor

@iOvergaard iOvergaard commented Dec 2, 2025

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.ts incorrectly assumed:

  • Windows → CTRL+Click
  • Everything else (Mac) → Meta (⌘)+Click

But Linux users also use CTRL+Click, not Meta. The fix changes the detection from "is Windows" to "is Mac", so:

  • Mac/iOS → Meta (⌘)+Click
  • Windows/Linux/everything else → CTRL+Click

Also replaced the deprecated navigator.platform with navigator.userAgent.

uui-tab href attribute (previous commit)

Changed href from attribute to property on <uui-tab> elements to avoid potential browser quirks with custom element attributes.

Test steps

Linux (Brave/Firefox)

  1. Open the BackOffice on Linux
  2. CTRL+Click on a section tab (e.g., Media, Settings)
  3. Expected: Opens in a new tab
  4. CTRL+Click on a tree item (e.g., a content node)
  5. Expected: Opens in a new tab

Mac (Safari/Chrome/Firefox)

  1. Open the BackOffice on Mac
  2. ⌘+Click on a section tab
  3. Expected: Opens in a new tab (no regression)

Windows (Chrome/Edge/Firefox)

  1. Open the BackOffice on Windows
  2. CTRL+Click on a section tab
  3. Expected: Opens in a new tab (no regression)

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

@iOvergaard iOvergaard added area/frontend preview/backoffice Pull requests that can be previewed in a static version of the Backoffice labels Dec 2, 2025
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-21027.westeurope.6.azurestaticapps.net

AndyButland and others added 3 commits December 3, 2025 12:25
…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>
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>
@iOvergaard iOvergaard changed the title fix: uses 'href' as property instead of attribute fix: CTRL+Click opens links in new tab on Linux Dec 3, 2025
@iOvergaard iOvergaard marked this pull request as ready for review December 3, 2025 12:38
Copilot AI review requested due to automatic review settings December 3, 2025 12:38
@github-actions
Copy link

github-actions bot commented Dec 3, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-21027.westeurope.6.azurestaticapps.net

@iOvergaard iOvergaard changed the title fix: CTRL+Click opens links in new tab on Linux fix: CTRL+Click opens links in new tab on Linux (closes #21009) Dec 3, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.platform with navigator.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

@iOvergaard iOvergaard changed the title fix: CTRL+Click opens links in new tab on Linux (closes #21009) Backoffice: CTRL+Click to open in a new tab should work on Linux (closes #21009) Dec 3, 2025
@iOvergaard iOvergaard changed the base branch from release/17.0 to main December 3, 2025 12:48
@iOvergaard
Copy link
Contributor Author

We must remember to backport this to V16 after merge.

@leekelleher leekelleher merged commit 84fecd3 into main Dec 3, 2025
32 checks passed
@leekelleher leekelleher deleted the v17/hotfix/section-uuitab-href branch December 3, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/frontend preview/backoffice Pull requests that can be previewed in a static version of the Backoffice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

V17 BackOffice UI overrides natural browser behaviour

3 participants