diff --git a/iced b/iced index 3cb80f6a..48bc1b9a 160000 --- a/iced +++ b/iced @@ -1 +1 @@ -Subproject commit 3cb80f6a054464cb14a86cf9bac41bf59ca959b0 +Subproject commit 48bc1b9a1de1e1ae0895f6760d1f9dd0a5d6d686 diff --git a/src/widget/text_input/input.rs b/src/widget/text_input/input.rs index c31f589a..bfa8a555 100644 --- a/src/widget/text_input/input.rs +++ b/src/widget/text_input/input.rs @@ -1241,7 +1241,16 @@ where state.dragging_state = Some(DraggingState::Selection); } } else { - state.dragging_state = None; + // existing logic for setting the selection + let position = if target > 0.0 { + update_cache(state, value); + find_cursor_position(text_layout.bounds(), value, state, target) + } else { + None + }; + + state.cursor.move_to(position.unwrap_or(0)); + state.dragging_state = Some(DraggingState::Selection); } } (None, click::Kind::Single, _) => {