Skip to content

Conversation

reakaleek
Copy link
Member

@reakaleek reakaleek commented Mar 14, 2025

Context

This was unintentionally removed in #721

@Copilot Copilot AI review requested due to automatic review settings March 14, 2025 10:57
@reakaleek reakaleek requested a review from a team as a code owner March 14, 2025 10:57
Copy link
Contributor

@Copilot 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 reintroduces shift and modifier key handling for opening links in a new window using htmx events.

  • Adds a listener for the htmx:beforeRequest event.
  • Implements OS-based modifier key checks to decide when to open links in a new tab.
Comments suppressed due to low confidence (1)

src/Elastic.Markdown/Assets/main.ts:19

  • Consider verifying that UAParser consistently returns 'macOS' for macOS devices. If it returns a different format (e.g., 'Mac OS'), the modifier key check might fail.
const modifierKey: boolean = os === 'macOS' ? metaKey : ctrlKey;

@reakaleek reakaleek self-assigned this Mar 14, 2025
@reakaleek reakaleek added the fix label Mar 14, 2025
@reakaleek reakaleek merged commit 475b431 into main Mar 14, 2025
8 checks passed
@reakaleek reakaleek deleted the feature/shift-mod-key branch March 14, 2025 11:14
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.

2 participants