Commit 3350c0c3 authored by krisgiesing's avatar krisgiesing

Merge pull request #415 from krisgiesing/editable_fix

Fix issue with forward-delete in editable text widget
parents f1f68f50 2acc2f6f
...@@ -105,8 +105,9 @@ class EditableString implements KeyboardClient { ...@@ -105,8 +105,9 @@ class EditableString implements KeyboardClient {
void deleteSurroundingText(int beforeLength, int afterLength) { void deleteSurroundingText(int beforeLength, int afterLength) {
TextRange beforeRange = new TextRange( TextRange beforeRange = new TextRange(
start: selection.start - beforeLength, end: selection.start); start: selection.start - beforeLength, end: selection.start);
int afterRangeEnd = math.min(selection.end + afterLength, text.length);
TextRange afterRange = TextRange afterRange =
new TextRange(start: selection.end, end: selection.end + afterLength); new TextRange(start: selection.end, end: afterRangeEnd);
_delete(afterRange); _delete(afterRange);
_delete(beforeRange); _delete(beforeRange);
selection = new TextRange( selection = new TextRange(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment