mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-18 20:05:05 -04:00
fix: consider simple table in exclude table types (#7478)
This commit is contained in:
parent
ea18aa7551
commit
a0ae62d6f5
2 changed files with 9 additions and 4 deletions
|
@ -1,5 +1,10 @@
|
|||
import 'package:appflowy/plugins/document/presentation/editor_plugins/simple_table/simple_table.dart';
|
||||
import 'package:appflowy_editor/appflowy_editor.dart';
|
||||
|
||||
bool _isTableType(String type) {
|
||||
return [TableBlockKeys.type, SimpleTableBlockKeys.type].contains(type);
|
||||
}
|
||||
|
||||
bool notShowInTable(EditorState editorState) {
|
||||
final selection = editorState.selection;
|
||||
if (selection == null) {
|
||||
|
@ -7,12 +12,12 @@ bool notShowInTable(EditorState editorState) {
|
|||
}
|
||||
final nodes = editorState.getNodesInSelection(selection);
|
||||
return nodes.every((element) {
|
||||
if (element.type == TableBlockKeys.type) {
|
||||
if (_isTableType(element.type)) {
|
||||
return false;
|
||||
}
|
||||
var parent = element.parent;
|
||||
while (parent != null) {
|
||||
if (parent.type == TableBlockKeys.type) {
|
||||
if (_isTableType(parent.type)) {
|
||||
return false;
|
||||
}
|
||||
parent = parent.parent;
|
||||
|
|
|
@ -1583,10 +1583,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: pdf
|
||||
sha256: adbdec5bc84d20e6c8d67f9c64270aa64d1e9e1ed529f0fef7e7bc7e9400f894
|
||||
sha256: "28eacad99bffcce2e05bba24e50153890ad0255294f4dd78a17075a2ba5c8416"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.11.2"
|
||||
version: "3.11.3"
|
||||
percent_indicator:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
Loading…
Add table
Reference in a new issue