mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: clear selection when editing inline database view
This commit is contained in:
parent
cf1096b516
commit
32c06cf1bf
@ -2,6 +2,7 @@ import 'package:appflowy/generated/locale_keys.g.dart';
|
|||||||
import 'package:appflowy/plugins/database_view/board/presentation/board_page.dart';
|
import 'package:appflowy/plugins/database_view/board/presentation/board_page.dart';
|
||||||
import 'package:appflowy/plugins/database_view/calendar/presentation/calendar_page.dart';
|
import 'package:appflowy/plugins/database_view/calendar/presentation/calendar_page.dart';
|
||||||
import 'package:appflowy/plugins/database_view/grid/presentation/grid_page.dart';
|
import 'package:appflowy/plugins/database_view/grid/presentation/grid_page.dart';
|
||||||
|
import 'package:appflowy/plugins/database_view/widgets/row/cells/text_cell/text_cell.dart';
|
||||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/base/link_to_page_widget.dart';
|
import 'package:appflowy/plugins/document/presentation/editor_plugins/base/link_to_page_widget.dart';
|
||||||
import 'package:appflowy/workspace/presentation/home/menu/view/view_item.dart';
|
import 'package:appflowy/workspace/presentation/home/menu/view/view_item.dart';
|
||||||
import 'package:appflowy_backend/protobuf/flowy-folder2/protobuf.dart';
|
import 'package:appflowy_backend/protobuf/flowy-folder2/protobuf.dart';
|
||||||
@ -31,6 +32,18 @@ void main() {
|
|||||||
),
|
),
|
||||||
findsOneWidget,
|
findsOneWidget,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// https://github.com/AppFlowy-IO/AppFlowy/issues/3533
|
||||||
|
// test: the selection of editor should be clear when editing the grid
|
||||||
|
await tester.editor.updateSelection(
|
||||||
|
Selection.collapsed(
|
||||||
|
Position(path: [1]),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
final gridTextCell = find.byType(GridTextCell).first;
|
||||||
|
await tester.tapButton(gridTextCell);
|
||||||
|
|
||||||
|
expect(tester.editor.getCurrentEditorState().selection, isNull);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('insert a referenced board', (tester) async {
|
testWidgets('insert a referenced board', (tester) async {
|
||||||
|
@ -82,7 +82,15 @@ class _DatabaseBlockComponentWidgetState
|
|||||||
|
|
||||||
child = Padding(
|
child = Padding(
|
||||||
padding: padding,
|
padding: padding,
|
||||||
child: child,
|
child: FocusScope(
|
||||||
|
skipTraversal: true,
|
||||||
|
onFocusChange: (value) {
|
||||||
|
if (value) {
|
||||||
|
context.read<EditorState>().selection = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (widget.showActions && widget.actionBuilder != null) {
|
if (widget.showActions && widget.actionBuilder != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user