fix: consider simple table in exclude table types (#7478)

This commit is contained in:
Richard Shiue 2025-03-07 12:32:27 +08:00 committed by GitHub
parent ea18aa7551
commit a0ae62d6f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View file

@ -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;

View file

@ -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: