Skip to content

Commit

Permalink
Fix event capturing in rich_text
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Feb 1, 2025
1 parent 7493b83 commit 2fc94d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions widget/src/text/rich.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,10 @@ where
.state
.downcast_mut::<State<Link, Renderer::Paragraph>>();

state.span_pressed = self.hovered_link;
shell.capture_event();
if self.hovered_link.is_some() {
state.span_pressed = self.hovered_link;
shell.capture_event();
}
}
Event::Mouse(mouse::Event::ButtonReleased(mouse::Button::Left)) => {
let state = tree
Expand Down

0 comments on commit 2fc94d9

Please sign in to comment.