Fix text selection with touch events in TextInput
This commit is contained in:
parent
056f7e6951
commit
70164f68a6
@ -320,10 +320,13 @@ where
|
|||||||
return event::Status::Captured;
|
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;
|
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 {
|
if self.state.is_dragging {
|
||||||
let text_layout = layout.children().next().unwrap();
|
let text_layout = layout.children().next().unwrap();
|
||||||
let target = position.x - text_layout.bounds().x;
|
let target = position.x - text_layout.bounds().x;
|
||||||
|
Loading…
Reference in New Issue
Block a user