mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-02-17 14:07:28 +08:00
fix: check text editing controlling, if selection is valid (#10868)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -3706,11 +3706,11 @@ Widget workaroundWindowBorder(BuildContext context, Widget child) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateTextAndPreserveSelection(TextEditingController controller, String text) {
|
void updateTextAndPreserveSelection(
|
||||||
final preSelectionStart = controller.selection.start;
|
TextEditingController controller, String text) {
|
||||||
final preSelectionEnd = controller.selection.end;
|
|
||||||
// Only care about select all for now.
|
// Only care about select all for now.
|
||||||
final isSelected = preSelectionEnd > preSelectionStart;
|
final isSelected = controller.selection.isValid &&
|
||||||
|
controller.selection.end > controller.selection.start;
|
||||||
|
|
||||||
// Set text will make the selection invalid.
|
// Set text will make the selection invalid.
|
||||||
controller.text = text;
|
controller.text = text;
|
||||||
|
|||||||
Reference in New Issue
Block a user