Skip to content

Commit

Permalink
fix: don't rebuild mobile toolbar everytime (AppFlowy-IO#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 authored Nov 7, 2023
1 parent 0bb39de commit a47fc6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/src/editor/toolbar/mobile/mobile_toolbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class MobileToolbar extends StatelessWidget {
buttonSelectedBorderWidth: buttonSelectedBorderWidth,
child: MobileToolbarWidget(
// Use selection as key to force rebuild toolbar widget when selection changed.
key: ValueKey(selection),
// key: ValueKey(selection),
editorState: editorState,
selection: selection,
toolbarItems: toolbarItems,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/editor/toolbar/mobile/mobile_toolbar_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
typedef MobileToolbarItemMenuBuilder = Widget Function(
EditorState editorState,
Selection selection,
// To accees to the state of MobileToolbarWidget
// To access to the state of MobileToolbarWidget
MobileToolbarWidgetService service,
);

Expand Down

0 comments on commit a47fc6f

Please sign in to comment.