Skip to content

Commit

Permalink
Fix text_editor capturing mouse release events
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Nov 4, 2024
1 parent 5e2024a commit be618aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions widget/src/text_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,6 @@ where
cursor,
self.key_binding.as_deref(),
) {
shell.capture_event();

match update {
Update::Click(click) => {
let action = match click.kind() {
Expand All @@ -679,6 +677,7 @@ where
state.drag_click = Some(click.kind());

shell.publish(on_edit(action));
shell.capture_event();
}
Update::Drag(position) => {
shell.publish(on_edit(Action::Drag(position)));
Expand All @@ -699,6 +698,7 @@ where
shell.publish(on_edit(Action::Scroll {
lines: lines as i32,
}));
shell.capture_event();
}
Update::Binding(binding) => {
fn apply_binding<
Expand Down Expand Up @@ -801,6 +801,8 @@ where
if let Some(focus) = &mut state.focus {
focus.updated_at = Instant::now();
}

shell.capture_event();
}
}
}
Expand Down

0 comments on commit be618aa

Please sign in to comment.