Skip to content

Commit

Permalink
Merge pull request #352 from microsoft/beta
Browse files Browse the repository at this point in the history
Fixes 262 Merging changes from beta to main branch
  • Loading branch information
MaheshSripada authored Sep 26, 2024
2 parents 5570485 + ab8be85 commit 67eee9e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion DetailsList/DetailsList/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,16 @@ export class FluentDetailsList implements ComponentFramework.ReactControl<IInput
if (raiseOnRowsSelectionChangeEvent && raiseOnRowsSelectionChangeEvent.raw === true) {
// When the row selection changes, raise an event
this.eventName = OutputEvents.OnRowSelectionChange;
this.eventRowKey = ids && ids.length > 0 ? ids[0] : null;
// Set the eventRowKey using the RecordKey of the first selected record
const firstSelectedId = ids.length > 0 ? ids[0] : null;
if (firstSelectedId) {
const firstRecord = this.records[firstSelectedId];
if (firstRecord) {
this.eventRowKey = firstRecord.getValue(RecordsColumns.RecordKey)?.toString() || firstSelectedId;
}
} else {
this.eventRowKey = null;
}
this.notifyOutputChanged();
}
};
Expand Down

0 comments on commit 67eee9e

Please sign in to comment.