Canvas: Fix datalinks using field variable (#87265)

This commit is contained in:
Drew Slobodnjak 2024-05-02 11:29:43 -07:00 committed by GitHub
parent f8d9f8541b
commit 6c7485129b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -119,7 +119,9 @@ const addDataLinkForField = (
): void => {
if (field?.getLinks) {
const disp = field.display ? field.display(data) : { text: `${data}`, numeric: +data! };
field.getLinks({ calculatedValue: disp }).forEach((link) => {
// TODO add more control over which row index each element uses
const valueRowIndex = field.values.length - 1;
field.getLinks({ calculatedValue: disp, valueRowIndex }).forEach((link) => {
const key = `${link.title}/${link.href}`;
if (!linkLookup.has(key)) {
links.push(link);