Skip to content

fix(VB-1820): navigate on alt+click of in-iframe links instead of swallowing the click#618

Merged
shivamfl merged 2 commits into
develop_v4from
VB-1820
Jul 10, 2026
Merged

fix(VB-1820): navigate on alt+click of in-iframe links instead of swallowing the click#618
shivamfl merged 2 commits into
develop_v4from
VB-1820

Conversation

@shivamfl

@shivamfl shivamfl commented Jul 10, 2026

Copy link
Copy Markdown

Summary

  • Alt+click on an in-iframe anchor was preventDefault'ed with no navigation ever dispatched, so link navigation inside the builder was completely broken.
  • Fix resolves the nearest anchor ancestor (handles clicks on nested formatted text/images inside a link), then explicitly drives navigation instead of relying on the browser's native click — browsers alt-click an anchor as a download, not a navigation, so relying on default behavior doesn't work.
  • target="_blank" links open in a new tab instead of hijacking the builder iframe; same-page #hash links still scroll natively.

Test plan

  • npx vitest run src/visualBuilder/listeners/__test__/mouseClick.test.ts — 10/10 pass
  • Full suite (npx vitest run) — all pass, no regressions
  • Manual verification in Visual Builder against a real entry with an RTE link

After fix

Screen.Recording.2026-07-10.at.5.10.41.PM.mov

@shivamfl shivamfl requested review from a team as code owners July 10, 2026 10:47
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 67.29% 2517 / 3740
🔵 Statements 66.15% 2555 / 3862
🔵 Functions 64.51% 449 / 696
🔵 Branches 61.79% 1522 / 2463
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/visualBuilder/listeners/mouseClick.ts 80.86% 77.01% 68.75% 82.88% 61, 74, 107-110, 119, 153, 165, 175-176, 191, 213-216, 232, 278, 337-342, 384-389, 408-416
Generated in workflow #855 for commit f856b0a by the Vitest Coverage Report Action

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.

Pull request overview

Fixes broken in-iframe link handling in the Visual Builder by ensuring Alt+click on links reliably triggers navigation (including resolving clicks on nested elements inside an <a>), rather than being swallowed with no navigation.

Changes:

  • Resolve the nearest anchor ancestor via closest("a") and explicitly navigate on Alt+click (including _blank behavior via window.open).
  • Add unit tests covering Alt+click navigation, _blank handling, and nested-element clicks inside anchors.

Reviewed changes

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

File Description
src/visualBuilder/listeners/mouseClick.ts Changes Alt+click handling to resolve nearest anchor and explicitly drive navigation/open-in-new-tab.
src/visualBuilder/listeners/test/mouseClick.test.ts Adds tests for Alt+click navigation behavior and nested-anchor resolution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/visualBuilder/listeners/mouseClick.ts Outdated
Comment thread src/visualBuilder/listeners/__test__/mouseClick.test.ts
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

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.

Pull request overview

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

Comment thread src/visualBuilder/listeners/mouseClick.ts

@hitesh-shetty-cstk hitesh-shetty-cstk 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.

LGTM!!

@shivamfl shivamfl merged commit d923a9d into develop_v4 Jul 10, 2026
10 checks passed
@shivamfl shivamfl deleted the VB-1820 branch July 10, 2026 12:40
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.

4 participants