summaryrefslogtreecommitdiffstats
path: root/native/src/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-12-15 06:48:12 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-12-15 06:48:12 +0100
commit70164f68a6cfca6f7c86cb5cb46e7b2b1f08cf2c (patch)
treeddb7ba1b690def0dcc26bcdaf54c2828b31e6481 /native/src/widget
parent056f7e6951f6e96da82f35626b8920f6853bea43 (diff)
downloadiced-70164f68a6cfca6f7c86cb5cb46e7b2b1f08cf2c.tar.gz
iced-70164f68a6cfca6f7c86cb5cb46e7b2b1f08cf2c.tar.bz2
iced-70164f68a6cfca6f7c86cb5cb46e7b2b1f08cf2c.zip
Fix text selection with touch events in `TextInput`
Diffstat (limited to 'native/src/widget')
-rw-r--r--native/src/widget/text_input.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs
index 1e84e22a..2fd9cec1 100644
--- a/native/src/widget/text_input.rs
+++ b/native/src/widget/text_input.rs
@@ -320,10 +320,13 @@ where
return event::Status::Captured;
}
}
- Event::Mouse(mouse::Event::ButtonReleased(mouse::Button::Left)) => {
+ Event::Mouse(mouse::Event::ButtonReleased(mouse::Button::Left))
+ | Event::Touch(touch::Event::FingerLifted { .. })
+ | Event::Touch(touch::Event::FingerLost { .. }) => {
self.state.is_dragging = false;
}
- Event::Mouse(mouse::Event::CursorMoved { position }) => {
+ Event::Mouse(mouse::Event::CursorMoved { position })
+ | Event::Touch(touch::Event::FingerMoved { position, .. }) => {
if self.state.is_dragging {
let text_layout = layout.children().next().unwrap();
let target = position.x - text_layout.bounds().x;