Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: clear selection extra info before inserting a new line #1009

Merged
merged 4 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions example/lib/pages/mobile_editor.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:universal_platform/universal_platform.dart';

class MobileEditor extends StatefulWidget {
const MobileEditor({
Expand Down Expand Up @@ -43,8 +44,6 @@ class _MobileEditorState extends State<MobileEditor> {

editorStyle = _buildMobileEditorStyle();
blockComponentBuilders = _buildBlockComponentBuilders();

editorState.debugInfo.debugPaintSizeEnabled = true;
}

@override
Expand Down Expand Up @@ -127,7 +126,9 @@ class _MobileEditorState extends State<MobileEditor> {
),
padding: const EdgeInsets.symmetric(horizontal: 24.0),
magnifierSize: const Size(144, 96),
mobileDragHandleBallSize: const Size.square(8),
mobileDragHandleBallSize: UniversalPlatform.isIOS
? const Size.square(12)
: const Size.square(8),
mobileDragHandleLeftExtend: 12.0,
mobileDragHandleWidthExtend: 24.0,
);
Expand Down
2 changes: 2 additions & 0 deletions lib/src/editor/command/text_commands.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ extension TextTransforms on EditorState {
offset: 0,
),
);
transaction.selectionExtraInfo = {};
transaction.customSelectionType = SelectionType.inline;

// Apply the transaction.
return apply(transaction);
Expand Down
Loading