Skip to content

Allow to open link in a new tab when pressing the modifier key (ctrl or cmd) - #714

Merged
reakaleek merged 2 commits into
mainfrom
feature/command-click-link
Mar 11, 2025
Merged

reakaleek merged 2 commits into
mainfrom
feature/command-click-link

Conversation

@reakaleek

@reakaleek reakaleek commented Mar 10, 2025 •

Copy link
Copy Markdown
Member

Closes #711

Result

cursorful-video-1741645572461.mp4

@reakaleek
reakaleek requested review from a team and Copilot March 10, 2025 22:09
@reakaleek reakaleek self-assigned this Mar 10, 2025
@reakaleek
reakaleek enabled auto-merge (squash) March 10, 2025 22:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Overview

This pull request adds a new behavior to open links in a new tab when the user holds down a modifier key (Ctrl on Windows/Linux, Cmd on macOS) during a get request.

  • Added UAParser integration to detect the operating system.
  • Implemented an event listener for htmx:beforeRequest to conditionally open links in a new tab based on modifier key input.

Reviewed Changes

File Description
src/Elastic.Markdown/Assets/main.ts Added OS detection and modifier key handling logic to open links in a new tab

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread src/Elastic.Markdown/Assets/main.ts Resolved
Comment thread src/Elastic.Markdown/Assets/main.ts Resolved
@reakaleek
reakaleek merged commit 6b629c3 into main Mar 11, 2025
@reakaleek
reakaleek deleted the feature/command-click-link branch March 11, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keyboard shortcuts don't work for opening in new tab/window

3 participants