Repository navigation
fix(editor): left-click on a link in read-only content opens two tabs - #10179
sriramveeraghanta merged 1 commit into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
4f339da to
5ad9692
Compare
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Hi @anmolsinghbhatia, whenever you have some free time, could you please review this PR? It's a small change. Happy to make any adjustments needed. Thanks! |
|
Hi @prateekshourya29, thanks for merging my earlier PRs. Whenever you get a chance, could you take a look at this one too? Happy to make any changes needed. |
|
@Krish6115 there is a merge conflict in this PR. Please look into it. |
5ad9692 to
3acd8eb
Compare
Hi @sriramveeraghanta , I have resolved the merge conflict with preview (upstream had reworked clickhandler so I rebased and kept the new handler with only the event.preventDefault() fix on top)... The Pr is mergable now :) |
Description
Left-clicking a link in a read-only (non-editable) comment or description opened it in two tabs. The
handleClickplugin inclickHandler.tscalledwindow.open(...)withoutevent.preventDefault(), so the browser also followed the native<a target="_blank">. In editable mode ProseMirror already suppresses the native click, which is why only read-only views were affected.The fix calls
event.preventDefault()beforewindow.open.Type of Change
Test Scenarios
Code-level change (one line); traced the handler path for editable and non-editable views. Not manually exercised in a browser.
References
Closes #9386
Summary by CodeRabbit