Skip to content

Commit

Permalink
Fix remanent contextual menu when selecting all on desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
amantoux committed Dec 8, 2023
1 parent 416244c commit 93f60bf
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion packages/fleather/lib/src/widgets/editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -910,8 +910,35 @@ class RawEditorState extends EditorState
),
cause,
);
userUpdateTextEditingValue(
textEditingValue.copyWith(
selection: TextSelection(
baseOffset: 0, extentOffset: textEditingValue.text.length),

Check warning on line 916 in packages/fleather/lib/src/widgets/editor.dart

View check run for this annotation

Codecov / codecov/patch

packages/fleather/lib/src/widgets/editor.dart#L913-L916

Added lines #L913 - L916 were not covered by tests
),
cause,
);

if (cause == SelectionChangedCause.toolbar) {
bringIntoView(textEditingValue.selection.extent);
switch (defaultTargetPlatform) {
case TargetPlatform.android:
case TargetPlatform.iOS:
case TargetPlatform.fuchsia:

Check warning on line 925 in packages/fleather/lib/src/widgets/editor.dart

View check run for this annotation

Codecov / codecov/patch

packages/fleather/lib/src/widgets/editor.dart#L922-L925

Added lines #L922 - L925 were not covered by tests
break;
case TargetPlatform.macOS:
case TargetPlatform.linux:
case TargetPlatform.windows:
hideToolbar();

Check warning on line 930 in packages/fleather/lib/src/widgets/editor.dart

View check run for this annotation

Codecov / codecov/patch

packages/fleather/lib/src/widgets/editor.dart#L927-L930

Added lines #L927 - L930 were not covered by tests
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
case TargetPlatform.fuchsia:
case TargetPlatform.linux:
case TargetPlatform.windows:
bringIntoView(textEditingValue.selection.extent);
case TargetPlatform.macOS:
case TargetPlatform.iOS:

Check warning on line 939 in packages/fleather/lib/src/widgets/editor.dart

View check run for this annotation

Codecov / codecov/patch

packages/fleather/lib/src/widgets/editor.dart#L932-L939

Added lines #L932 - L939 were not covered by tests
break;
}
}
}

Expand Down

0 comments on commit 93f60bf

Please sign in to comment.