Skip to content

Open links with ctrl/cmd+click#976

Merged
zachasme merged 1 commit intomainfrom
link-opener
Apr 16, 2026
Merged

Open links with ctrl/cmd+click#976
zachasme merged 1 commit intomainfrom
link-opener

Conversation

@zachasme
Copy link
Copy Markdown
Contributor

@zachasme zachasme commented Apr 14, 2026

Make links non-editable while ctrl/cmd is held, allowing the browser to handle link navigation natively.

A simple click handler intercepting cmd/ctrl+click and calling window.open works for opening links, but it doesn't give the user any visual feedback on hover. Tracking modifier key state for cursor styling separately gets messy because browsers don't always provide truthful values for pointer events when the key was initially held in a non-browser window.

By toggling contenteditable we rely on native browser behavior and ensure visual feedback matches behavior in all edge cases.

Copilot AI review requested due to automatic review settings April 14, 2026 17:16

This comment was marked as resolved.

Links become non-editable with target="_blank" while the platform
modifier key is held (Cmd on macOS, Ctrl elsewhere), allowing the
browser to handle link navigation natively.

This comment was marked as resolved.

Copy link
Copy Markdown
Member

@jorgemanrubia jorgemanrubia left a comment

Choose a reason for hiding this comment

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

👏👏

@zachasme zachasme merged commit 37053fd into main Apr 16, 2026
16 checks passed
@zachasme zachasme deleted the link-opener branch April 16, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants