Fix automation test modal row select losing track of the selected row.

This commit is contained in:
Sam Rose 2025-01-28 12:01:58 +00:00
parent 4a41207877
commit d1a7eb88bd
No known key found for this signature in database
1 changed files with 5 additions and 2 deletions

View File

@ -424,7 +424,7 @@
autocomplete: true, autocomplete: true,
filter: false, filter: false,
getOptionLabel: row => row?.[primaryDisplay] || "", getOptionLabel: row => row?.[primaryDisplay] || "",
compare: (a, b) => a?._id === b?._id, compare: (a, b) => a?.[primaryDisplay] === b?.[primaryDisplay],
onChange: e => { onChange: e => {
if (isTestModal) { if (isTestModal) {
onChange({ onChange({
@ -651,7 +651,10 @@
...request, ...request,
} }
if (newTestData?.row?._id == null) { if (
newTestData?.row == null ||
Object.keys(newTestData?.row).length === 0
) {
selectedRow = null selectedRow = null
} else { } else {
selectedRow = newTestData.row selectedRow = newTestData.row