# Rich text hyper link greyed out and not working

**URL:** <https://forums.unrealengine.com/t/rich-text-hyper-link-greyed-out-and-not-working/564344>\
**Category:** C++\
**Tags:** unreal-engine, Widget, UE4-27, question, CPP\
**Created:** [May 23, 2022, 3:56pm UTC](https://forums.unrealengine.com/t/rich-text-hyper-link-greyed-out-and-not-working/564344 "2022-05-23T15:56:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beyond\_edge](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Beyond\_edge](https://forums.unrealengine.com/u/Beyond_edge)\
**Post date:** [May 23, 2022, 3:56pm UTC](https://forums.unrealengine.com/t/rich-text-hyper-link-greyed-out-and-not-working/564344/1 "2022-05-23T15:56:39Z")

</div>

Hi I’ve tried following this tutorial [UMG RichTextBlock hyperlink / href markup](https://forums.unrealengine.com/t/umg-richtextblock-hyperlink-href-markup/454860/2) to add hyperlinks to a rich text box, but it doesn’t work as can be seen when I press play the links greyed out (screen shot below) and when I click on it, it doesn’t print the message.

Is this method not valid any more or am I doing something wrong? I would appreciate any help, code will be below.

Screen shot

 ![Screenshot (374)](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/6/d/06dfd38d13c754d0a28fcaa4d5d585e9882c5710.jpeg)

.H

```auto
class FRichInlineHyperLinkDecorator : public FRichTextDecorator
{
public:
	FRichInlineHyperLinkDecorator(URichTextBlock* InOwner, UHyperLinkRichTextDecorator* decorator);

	virtual bool Supports(const FTextRunParseResults& RunParseResult, const FString& Text) const override;

protected:
	virtual TSharedPtr<SWidget> CreateDecoratorWidget(const FTextRunInfo& RunInfo, const FTextBlockStyle& TextStyle) const override;

	FHyperlinkStyle linkstyle;
	FSimpleDelegate del;
	mutable FString idString;
};

UCLASS()
class UNREALCOC_API UHyperLinkRichTextDecorator : public URichTextBlockDecorator
{
	GENERATED_BODY()

public:
	UHyperLinkRichTextDecorator(const FObjectInitializer& ObjectInitializer);

	virtual TSharedPtr<ITextDecorator> CreateDecorator(URichTextBlock* InOwner) override;

	UPROPERTY(EditAnywhere, Category = Appearance)
	FHyperlinkStyle style;

	UFUNCTION(BlueprintNativeEvent)
	void ClickFun();
	
};

```

.cpp

```auto
//F
FRichInlineHyperLinkDecorator::FRichInlineHyperLinkDecorator(URichTextBlock* InOwner, UHyperLinkRichTextDecorator* decorator) : FRichTextDecorator(InOwner)
{
	linkstyle = decorator->style;
	del.BindLambda([=]() {
		decorator->ClickFun();
		});
}

bool FRichInlineHyperLinkDecorator::Supports(const FTextRunParseResults& RunParseResult, const FString& Text) const
{
	if (RunParseResult.Name == TEXT("Link") && RunParseResult.MetaData.Contains(TEXT("id")))
	{
		const FTextRange& IdRange = RunParseResult.MetaData[TEXT("id")];
		idString = Text.Mid(IdRange.BeginIndex, IdRange.EndIndex - IdRange.BeginIndex);
		return true;
	}
	return false;
}

TSharedPtr<SWidget> FRichInlineHyperLinkDecorator::CreateDecoratorWidget(const FTextRunInfo& RunInfo, const FTextBlockStyle& TextStyle) const
{
	const bool bWarnIfMissing = true;

	TSharedPtr<FSlateHyperlinkRun::FWidgetViewModel> model = MakeShareable(new FSlateHyperlinkRun::FWidgetViewModel);

	TSharedPtr<SRichTextHyperlink> link = SNew(SRichTextHyperlink, model.ToSharedRef())
		.Text(FText::FromString("link"))
		.Style(&linkstyle)
		.OnNavigate(del);

	return link;
}

//U
UHyperLinkRichTextDecorator::UHyperLinkRichTextDecorator(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{

}

TSharedPtr<ITextDecorator> UHyperLinkRichTextDecorator::CreateDecorator(URichTextBlock* InOwner)
{
	return MakeShareable(new FRichInlineHyperLinkDecorator(InOwner, this));
}

void UHyperLinkRichTextDecorator::ClickFun_Implementation()
{
	if (GEngine) {
		GEngine->AddOnScreenDebugMessage(-1, 20, FColor::Red, "click link");
	}
}

```

---

<div class="post-metadata">

**Author:** ![Beyond\_edge](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Beyond\_edge](https://forums.unrealengine.com/u/Beyond_edge)\
**Post date:** [June 7, 2022, 8:03am UTC](https://forums.unrealengine.com/t/rich-text-hyper-link-greyed-out-and-not-working/564344/2 "2022-06-07T08:03:33Z")

</div>

I figured out the problem, my rich text box was the child of the scroll box and for some reason the delegate can’t detect input from within the scroll box, so the problem was solved by removing the rich text block from the scroll box

---

<div class="post-metadata">

**Author:** ![m00nB33r](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/m00nb33r/32/88714_2.png) [@m00nB33r](https://forums.unrealengine.com/u/m00nB33r)\
**Post date:** [May 29, 2024, 10:41pm UTC](https://forums.unrealengine.com/t/rich-text-hyper-link-greyed-out-and-not-working/564344/3 "2024-05-29T22:41:02Z")

</div>

Does work like a regular hyperlink and open a browser and navigate you to that page?
