[desktop] fix: 修复超链接中键点击硬控 GUI (#3505)#3564
Merged
Merged
Conversation
Add onAuxClick and onMouseDown handlers to <a> in Markdown component to intercept middle-click events and open links via openExternal() instead of allowing default browser navigation behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复内容
修复 AI 回复中的超链接被鼠标中键点击时,会导致整个 webview 被导航走(界面硬控)的问题。
根因
\Markdown.tsx\ 中的 <a>\ 组件只处理了 \onClick\ 事件,但鼠标中键触发的是 \�uxclick\ 事件,未被拦截,导致浏览器默认行为执行(在 webview 中直接导航)。
修复方案
测试
pm run typecheck\ 通过
pm run check:css\ 通过
Fixes #3505