mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
fix(app): preventDefault in capture phase for MarkdownLink anchor
Pressable's click handler calls stopPropagation, so the bubble-phase preventDefault on the wrapping <a> never fired and the Electron view navigated to the href in addition to the existing helper opening it in the OS browser. Move preventDefault to onClickCapture (and onAuxClickCapture for middle-click) so it always runs first. The existing Pressable.onPress helper remains the only path that actually opens links.
This commit is contained in:
@@ -908,7 +908,12 @@ function MarkdownLink({
|
||||
}
|
||||
|
||||
return (
|
||||
<a href={href} onClick={preventAnchorNavigation} style={MARKDOWN_LINK_ANCHOR_STYLE}>
|
||||
<a
|
||||
href={href}
|
||||
onClickCapture={preventAnchorNavigation}
|
||||
onAuxClickCapture={preventAnchorNavigation}
|
||||
style={MARKDOWN_LINK_ANCHOR_STYLE}
|
||||
>
|
||||
<Pressable
|
||||
accessibilityRole="link"
|
||||
onPress={handlePress}
|
||||
|
||||
Reference in New Issue
Block a user