mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
UIViewComponentPeer: Maintain TextEditor cursor position during deleteBackward
This commit is contained in:
parent
df45aaeb7b
commit
c666381ef9
1 changed files with 3 additions and 0 deletions
|
|
@ -919,7 +919,10 @@ MultiTouchMapper<UITouch*> 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 ("");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue