Skip to content

Commit

Permalink
feat: clear selection extra info before inserting a new line (#1009)
Browse files Browse the repository at this point in the history
* feat: enable debug paint size for mobile drag handle

* fix: clear selection extra info when inserting new line

* Revert "feat: enable debug paint size for mobile drag handle"

This reverts commit 3ece3c6.
  • Loading branch information
LucasXu0 authored Dec 30, 2024
1 parent b52ce3b commit cfb8b1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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

0 comments on commit cfb8b1b

Please sign in to comment.