linkId in props seems to break the matrix widget props

Hello

I had a matrix working fine with the OSC version it was created with (I can't remember which one) and using the newer ones it got a problem. For this example, I'm on OSC version 1.15.0.

The problem appears when adding a "linkId" prop in the props field of the matrix.
The minimal attached session can help to see what is going on.
The way it is, the buttons and the matrix value don't update and all the other props are not applied.
If you comment the "linkId" line in the props, (and make sure to manually update the matrix value - I do this by changing the onValue field, even by adding/removing blank lines, otherwise the matrix will get stuck with fixed values, as you can see in the console.log), the matrix works normally again.

No error message is displayed.

Thanks for the support and for this amazing software!
linkId-in-matrix.json (3.8 KB)

Actually there is an error message when the widget is created because of this line:

"colorWidget": `@{this}[$] == 1 ? "limegreen" : "white"`,

@{this} is not yet defined when props is evaluated, writing

(@{this} || [])[$] instead of @{this}[$]

would avoid the error (and make it work), but since what you want is for each button to read its own value there's a better way to write it:

"colorWidget": `#_{@_{this} == 1 ? "limegreen" : "white"}`,

The underscore allows passing the #{} and @{} blocks to the child widget, this way the matrix' props is not reevaluated whenever a button is pressed (that's why I'd advise to remove the console.log(@{this}) line as well.)

1 Like

Oh, thank you very much for the detailed explanation. Now I have a better understanding of how the matrix works.
Amazing stuff!
Thanks again man :pray: