Parcourir la source

fix: transparent color should be treated as a highlight color

Lucas.Xu il y a 2 ans
Parent
commit
04e14c6bba

+ 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,