Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Remove the Start typing placeholder from the lander editor.

Cursor Agent0080e89aa530
diff --git a/apps/web/ui/partners/groups/design/lander/lander-rich-text-editor.tsx b/apps/web/ui/partners/groups/design/lander/lander-rich-text-editor.tsx
index d64471652b..a077665eaa 100644
--- a/apps/web/ui/partners/groups/design/lander/lander-rich-text-editor.tsx
+++ b/apps/web/ui/partners/groups/design/lander/lander-rich-text-editor.tsx
@@ -14,7 +14,7 @@ export function LanderRichTextEditor({
id,
value,
onChange,
- placeholder = "Start typing...",
+ placeholder = "",
error,
editorClassName,
maxLength,
diff --git a/apps/web/ui/partners/groups/design/lander/modals/accordion-block-modal.tsx b/apps/web/ui/partners/groups/design/lander/modals/accordion-block-modal.tsx
index 49f538f54a..8be86df876 100644
--- a/apps/web/ui/partners/groups/design/lander/modals/accordion-block-modal.tsx
+++ b/apps/web/ui/partners/groups/design/lander/modals/accordion-block-modal.tsx
@@ -227,7 +227,6 @@ function AccordionBlockModalInner({
id={`${id}-${field.id}-content`}
value={contentField.value}
onChange={contentField.onChange}
- placeholder="Start typing"
error={Boolean(fieldErrors?.content)}
editorClassName="max-h-32 min-h-16"
maxLength={ACCORDION_ITEM_CONTENT_MAX_LENGTH}
diff --git a/packages/ui/src/rich-text-area/rich-text-provider.tsx b/packages/ui/src/rich-text-area/rich-text-provider.tsx
index 17e3b2cac8..80bbd6d8eb 100644
--- a/packages/ui/src/rich-text-area/rich-text-provider.tsx
+++ b/packages/ui/src/rich-text-area/rich-text-provider.tsx
@@ -259,7 +259,25 @@ export const RichTextProvider = forwardRef<
: []),
Placeholder.configure({
- placeholder: () => placeholderRef.current,
+ placeholder: ({ editor, node, pos }) => {
+ const text = placeholderRef.current;
+ if (!text) return "";
+
+ // The placeholder decorates the top-level empty node. An empty
+ // table is that node, so the text would show inside the first cell.
+ const isTable = (name: string) =>
+ name === "table" ||
+ name === "tableCell" ||
+ name === "tableHeader";
+ if (isTable(node.type.name)) return "";
+
+ const $pos = editor.state.doc.resolve(pos);
+ for (let depth = $pos.depth; depth > 0; depth--) {
+ if (isTable($pos.node(depth).type.name)) return "";
+ }
+
+ return text;
+ },
emptyEditorClass:
"before:content-[attr(data-placeholder)] before:float-left before:text-content-muted before:h-0 before:pointer-events-none",
}),