Iterating through a matrix with nested loops (i, j), the same method gets called twice with the arguments swapped depending on their relative values REPL. Extract below.
{{#each triangularMatrix as ri, i}}
<tr>
{{#each triangularMatrix as rj, j}}
{{#if i > j}}
<td><input type="number" value={{ri[j]}} on:click='lowerThan(j, i)'></td>
{{elseif i === j}}
<td>1</td>
{{else}}
<td><input type="number" value={{rj[i]}} on:click='lowerThan(i, j)'></td>
{{/if}}
{{/each}}
</tr>
{{/each}}
the lowerThan function is called twice with the arguments swapped:
<td ... on:click='lowerThan(i, j) //correct<td ... on:click='lowerThan(j, i) //always failsIn the generated code, a single change handler is registered and the arguments get swapped on the second call (ie the second assertion always fails).
The indices in the view are fine, the problem is only with the event handlers
I think I know what's going on here — two event handlers are being created, but they're both being given the name click_handler rather than click_handler and click_handler_1. Fairly sure I know how to fix that... on it
This is fixed in 1.14 — thanks
Most helpful comment
This is fixed in 1.14 — thanks