Skip to content

Scheduling infrastructure for absolutely everyone.

fix: Description field duplicating content when editing Event Types (#24233)

Parship Chowdhuryf8614f11ff12
diff --git a/packages/ui/components/editor/plugins/ToolbarPlugin.tsx b/packages/ui/components/editor/plugins/ToolbarPlugin.tsx
index 24cb75e3033..58ab9f9b762 100644
--- a/packages/ui/components/editor/plugins/ToolbarPlugin.tsx
+++ b/packages/ui/components/editor/plugins/ToolbarPlugin.tsx
@@ -35,8 +35,6 @@ import { AddVariablesDropdown } from "./AddVariablesDropdown";
const LowPriority = 1;
-const supportedBlockTypes = new Set(["paragraph", "h1", "h2", "ul", "ol"]);
-
interface BlockType {
[key: string]: string;
}
@@ -366,6 +364,10 @@ export default function ToolbarPlugin(props: TextEditorProps) {
if (props.setFirstRender) {
props.setFirstRender(false);
editor.update(() => {
+ const currentContent = $getRoot().getTextContent().trim();
+ if (currentContent) {
+ return;
+ }
const parser = new DOMParser();
const dom = parser.parseFromString(props.getText(), "text/html");
@@ -428,7 +430,7 @@ export default function ToolbarPlugin(props: TextEditorProps) {
return (
<div className="toolbar flex" ref={toolbarRef}>
<>
- {!props.excludedToolbarItems?.includes("blockType") && supportedBlockTypes.has(blockType) && (
+ {!props.excludedToolbarItems?.includes("blockType") && (
<>
<Dropdown>
<DropdownMenuTrigger className="text-subtle">