From 24de12518224d82c9829d51c0f00a3ecee6d0b3a Mon Sep 17 00:00:00 2001 From: "dong.nguyen" Date: Fri, 23 Oct 2026 09:31:45 +0700 Subject: [PATCH] fix(edit): forward ref and editing props through Tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tag dropped every prop beyond children/accent/className, so the editing surface EditableText attaches (ref, contentEditable, key/blur handlers) never reached the span: tags rendered through as={Tag} — interests, philosophy keywords, project-detail technologies — showed a pencil but never became editable (React 19: ref is a plain prop the component must declare). Tag is now a pass-through; visitor markup is unchanged. --- src/components/ui/Tag.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/ui/Tag.tsx b/src/components/ui/Tag.tsx index 38395f9..0311e8f 100644 --- a/src/components/ui/Tag.tsx +++ b/src/components/ui/Tag.tsx @@ -1,12 +1,16 @@ -interface TagProps { +interface TagProps extends React.HTMLAttributes { children: React.ReactNode accent?: boolean className?: string + // EditableText/TagListEditor attach editing props to the element they render + // through (ref, contentEditable, key/blur handlers) — Tag must forward them + // or the element never becomes editable in edit mode (React 19: ref is a prop). + ref?: React.Ref } -export function Tag({ children, accent = false, className = '' }: TagProps) { +export function Tag({ children, accent = false, className = '', ref, ...rest }: TagProps) { return ( - + {children} )