Fire markdown link on mouse down

Previously any amount of mouse movement would disqualify the mouse down
and up from being a click, being a drag instead, which is a long
standing UX issue. We can get away with just firing on mouse down here
for now
This commit is contained in:
Julia 2023-10-11 14:39:34 -04:00
parent 0cec0c1c1d
commit a09ee3a41b

View file

@ -154,7 +154,7 @@ pub fn render_parsed_markdown<Tag: 'static>(
});
cx.scene().push_mouse_region(
MouseRegion::new::<(RenderedMarkdown, Tag)>(view_id, region_id, bounds)
.on_click::<Editor, _>(MouseButton::Left, move |_, _, cx| {
.on_down::<Editor, _>(MouseButton::Left, move |_, _, cx| {
cx.platform().open_url(&url)
}),
);