Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9e5212e

Browse files
committed
fix: Check selection and composing range
1 parent 50cc085 commit 9e5212e

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

packages/flutter/lib/src/widgets/editable_text.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6435,7 +6435,11 @@ class _UpdateTextSelectionAction<T extends DirectionalCaretMovementIntent>
64356435

64366436
@override
64376437
bool get isActionEnabled {
6438-
if (kIsWeb && state.widget.selectionEnabled) {
6438+
if (state.widget.selectionEnabled &&
6439+
kIsWeb &&
6440+
(state._value.selection.isCollapsed ||
6441+
state._value.composing.isCollapsed ||
6442+
state._value.selection == state._value.composing)) {
64396443
return false;
64406444
}
64416445

@@ -6521,7 +6525,11 @@ class _UpdateTextSelectionVerticallyAction<T extends DirectionalCaretMovementInt
65216525

65226526
@override
65236527
bool get isActionEnabled {
6524-
if (kIsWeb && state.widget.selectionEnabled) {
6528+
if (state.widget.selectionEnabled &&
6529+
kIsWeb &&
6530+
(state._value.selection.isCollapsed ||
6531+
state._value.composing.isCollapsed ||
6532+
state._value.selection == state._value.composing)) {
65256533
return false;
65266534
}
65276535

0 commit comments

Comments
 (0)