From 05b791653e26b60799f4feda6b89514095b9693b Mon Sep 17 00:00:00 2001 From: Elijah Ahianyo Date: Tue, 10 Dec 2024 17:14:29 +0000 Subject: [PATCH] Default `rx.link` href to `#` so underline prop works (#4509) --- reflex/components/radix/themes/typography/link.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reflex/components/radix/themes/typography/link.py b/reflex/components/radix/themes/typography/link.py index 1cc673536..25a0902cc 100644 --- a/reflex/components/radix/themes/typography/link.py +++ b/reflex/components/radix/themes/typography/link.py @@ -77,13 +77,14 @@ class Link(RadixThemesComponent, A, MemoizationLeaf, MarkdownComponentMap): Component: The link component """ props.setdefault(":hover", {"color": color("accent", 8)}) + href = props.get("href") is_external = props.pop("is_external", None) if is_external is not None: props["target"] = cond(is_external, "_blank", "") - if props.get("href") is not None: + if href is not None: if not len(children): raise ValueError("Link without a child will not display") @@ -101,6 +102,9 @@ class Link(RadixThemesComponent, A, MemoizationLeaf, MarkdownComponentMap): as_child=True, **props, ) + else: + props["href"] = "#" + return super().create(*children, **props)