瀏覽代碼

fix: transparent color should be treated as a highlight color

Lucas.Xu 2 年之前
父節點
當前提交
04e14c6bba
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      frontend/app_flowy/packages/appflowy_editor/lib/src/render/toolbar/toolbar_item.dart

+ 3 - 1
frontend/app_flowy/packages/appflowy_editor/lib/src/render/toolbar/toolbar_item.dart

@@ -255,7 +255,9 @@ List<ToolbarItem> defaultToolbarItems = [
     highlightCallback: (editorState) => _allSatisfy(
       editorState,
       BuiltInAttributeKey.backgroundColor,
-      (value) => value != null,
+      (value) {
+        return value != null && value != '0x00000000'; // transparent color;
+      },
     ),
     handler: (editorState, context) => formatHighlight(
       editorState,