Aug 02 2021 06:09 PM
How to reproduce:
Environment: SharePoint Online - Modern Communication Site Registered as a Hub (Targeted Release)
1. Create a new Hyperlink column in a modern SPO list.
2. Add an item and make sure to completely fill out URL AND alternate text - you will notice that a hyperlink is created in the column and it is indeed clickable. This is to be expected.
3. Go to column settings/format this column.
4. Manage the default rule so that the text has no fill and is bold (more styles).
You will now notice that the text is bold; however, it is no longer a hyperlink and therefore no longer clickable.
Is this by design or is it a bug?
Aug 03 2021 04:23 AM
Aug 22 2023 11:48 PM
Aug 23 2023 02:00 AM
Yes, this bug is still there in the SharePoint. Instead of using default styling and color options, use JSON like below in "Advanced mode" of the column formatting option for hyperlink column:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"style": {
"box-sizing": "border-box",
"padding": "0 2px",
"overflow": "hidden",
"text-overflow": "ellipsis",
"text-decoration": "none",
"color": "#555555"
},
"attributes": {
"class": "sp-field-fontSizeSmall sp-field-bold",
"href": "[$HyperlinkCol]"
},
"txtContent": "[$HyperlinkCol.desc]"
}
Where HyperlinkCol is the internal name of hyperlink column. You can get the internal name of your column by following this article: How to find the Internal name of columns in SharePoint Online?
OR use @currentField for href and @currentField.desc for txtContent.
Output:
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.