summaryrefslogtreecommitdiffstats
path: root/widget/src/text_editor.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-20 01:23:50 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-20 01:23:50 +0200
commit29fb4eab878a7ba399cae6ab1ec18a71e369ee59 (patch)
tree2919b76b127783fdb922b55be92da7ae0509b63d /widget/src/text_editor.rs
parentff78e97ad7df4db3b2a97b94e99854f2f9e3021a (diff)
downloadiced-29fb4eab878a7ba399cae6ab1ec18a71e369ee59.tar.gz
iced-29fb4eab878a7ba399cae6ab1ec18a71e369ee59.tar.bz2
iced-29fb4eab878a7ba399cae6ab1ec18a71e369ee59.zip
Scroll `TextEditor` only if `cursor.is_over(bounds)`
Diffstat (limited to 'widget/src/text_editor.rs')
-rw-r--r--widget/src/text_editor.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs
index c384b8a2..4191e02c 100644
--- a/widget/src/text_editor.rs
+++ b/widget/src/text_editor.rs
@@ -539,7 +539,9 @@ impl Update {
}
_ => None,
},
- mouse::Event::WheelScrolled { delta } => {
+ mouse::Event::WheelScrolled { delta }
+ if cursor.is_over(bounds) =>
+ {
action(Action::Scroll {
lines: match delta {
mouse::ScrollDelta::Lines { y, .. } => {