Skip to content

Commit

Permalink
feat: disable selected condition option name
Browse files Browse the repository at this point in the history
  • Loading branch information
geoje committed Nov 5, 2024
1 parent 60db0cc commit 3273692
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/src/pages/enhance/6-execute/potential/autoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ export default function AutoModal({
grades: condition.grades,
}}
options={selectOptions}
isOptionDisabled={(option) =>
conditions.some(({ name }) => name == option.label)
}
onChange={(option) => {
if (!option) {
if (onDelete) onDelete(i);
Expand Down Expand Up @@ -251,6 +254,9 @@ export default function AutoModal({
size="sm"
components={components}
options={selectOptions}
isOptionDisabled={(option) =>
(conditions ?? []).some(({ name }) => name == option.label)
}
onChange={(option) => {
if (!onCreate || !option) return;
const infosByName = conditionInfos[option.label];
Expand Down

0 comments on commit 3273692

Please sign in to comment.