diff --git a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm index b83c036e7a..aad028dae1 100644 --- a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm @@ -919,7 +919,10 @@ MultiTouchMapper UIViewComponentPeer::currentTouches; const auto rangeToDelete = range.isEmpty() ? range.withStartAndLength (jmax (range.getStart() - 1, 0), range.getStart() != 0 ? 1 : 0) : range; + const auto start = rangeToDelete.getStart(); + // This ensures that the cursor is at the beginning, rather than the end, of the selection + target->setHighlightedRegion ({ start, start }); target->setHighlightedRegion (rangeToDelete); target->insertTextAtCaret (""); }