diff --git a/src/views/ChoreEdit/ChoreEdit.jsx b/src/views/ChoreEdit/ChoreEdit.jsx index 8dcf06b8..26fe6016 100644 --- a/src/views/ChoreEdit/ChoreEdit.jsx +++ b/src/views/ChoreEdit/ChoreEdit.jsx @@ -579,8 +579,10 @@ const ChoreEdit = () => { if (assignees.length === 0) { setAssignStrategy('no_assignee') setAssignedTo(null) - } else if (assignees.length === 1) { - setAssignedTo(assignees[0].userId) + } else { + if (!assignees.some(a => a.userId === assignedTo)) { + setAssignedTo(assignees[0].userId) + } if (assignStrategy === 'no_assignee') { setAssignStrategy(ASSIGN_STRATEGIES[2]) // default to least_completed } @@ -1014,17 +1016,12 @@ const ChoreEdit = () => { } disabled={assignees.length === 0} value={assignedTo > -1 ? assignedTo : null} + onChange={(_, selectedUserId) => setAssignedTo(selectedUserId)} > {performers - ?.filter(p => assignees.find(a => a.userId == p.userId)) + ?.filter(p => assignees.some(a => a.userId == p.userId)) .map((item, index) => ( - ))}