Hi there
I’ve created a UI Kit customfield for Jira that renders a url of another Jira ticket using the Link inline component and although the link is rendering correctly, nothing happens when I click on it.
Is this a bug or must I recreate the field using CustomUI and use a router to navigate to the new link?
I tested with both a relative path and a full path and in both cases, clicking the link does nothing.
My code below
import ForgeUI, { CustomField, render, Text, TextField, useProductContext, Link, useState, Em } from "@forge/ui";
import {getIssueTeamTicket} from "./api";
const View = () => {
const context = useProductContext();
const [teamTicket, setTeamTicket] = useState(getIssueTeamTicket(context.platformContext.issueKey));
if(teamTicket ==null){
return (
<CustomField>
<Text></Text>
</CustomField>
);
}
else{
return (
<CustomField>
<Text>
<Em>Right-click on link below and click 'Open in new tab' to open link</Em>
</Text>
<Text>
//teamTicket below will be a ticket key, for ex DEM-1.
// the url, in this case, resolves to https://<my jira cloud instance>/browse/DEM-1
<Link appearance="link" openNewTab={true} href={teamTicket}>
{teamTicket}
</Link>
</Text>
</CustomField>
);
}
};
export const runView = render(<View/>);
When you right-click on the link and open it, it opens successfully. I’m also assuming, once the navigation works, the open in new tab will work as well.
I also pasted the example used here and the behaviour is the same. Link renders but no navigation to the url when I click on it.