Skip to content

Commit

Permalink
Always keep natural order of selection boundaries
Browse files Browse the repository at this point in the history
when setting clipboard data
  • Loading branch information
amantoux committed Aug 11, 2024
1 parent e7c7a9a commit 14d871e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/fleather/lib/src/widgets/editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,8 @@ class RawEditorState extends EditorState
plainText: selection.textInside(textEditingValue.text),
delta: controller.document
.toDelta()
.slice(selection.baseOffset, selection.extentOffset),
.slice(math.min(selection.baseOffset, selection.extentOffset),
math.max(selection.baseOffset, selection.extentOffset)),
));
}

Expand Down

0 comments on commit 14d871e

Please sign in to comment.