Skip to content

Commit c236686

Browse files
committed
The targeted keys state is now set from the rows function
prior to this change the targeted keys were populated from the metrics pool state. This created an issue where the rows in the table were not matching up with the values in the metrics pool state. Now when the rows are selected the rows variable is referenced so that the data is the same
1 parent ee7ed1c commit c236686

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

app/components/TransferColumns.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,26 +225,31 @@ const TransferColumns = React.memo(() => {
225225
checkboxSelection
226226
disableSelectionOnClick
227227
onSelectionModelChange={metricIndeces => {
228-
console.log({metricIndeces})
229228
const metrics: any[] = [];
230229
metricIndeces.forEach(el => {
231-
metrics.push(metricsPool[el].key);
230+
console.log({rows})
231+
metrics.push(`${rows[el].tag} | ${rows[el].title}`);
232232
});
233233
setTargetKeys(metrics);
234234
}}
235235
/>
236236

237237
</div>
238238
{selectedRows.length > 0 && (
239-
<h3 style={{
239+
<h3
240+
style={{
240241
marginTop: '20px',
241242
color: currentMode.color
242243
}}
243244
>
244245
Selected Rows:
245246
</h3>
246247
)}
247-
<ol id="selectedRows">{selectedRows}</ol>
248+
<ol
249+
id="selectedRows"
250+
>
251+
{selectedRows}
252+
</ol>
248253
</div>
249254
</>
250255
);

0 commit comments

Comments
 (0)