Skip to content

Commit 9622f39

Browse files
scriptcodedclaude
andcommitted
fix: show a spinner instead of a dead button while confirming subjects
ScoutButton has a `loading` prop that renders a centered spinner and hides the label, and it already implies disabled (the render sets the underlying disabled attribute and suppresses the click), so it replaces the extra disabled condition. `disabled` stays for the empty-selection case, where there is nothing to communicate beyond "not available". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 51d968c commit 9622f39

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

plugins/base/src/selectSubjects/frontend/screens/SelectSubjectScreen.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ export function SelectSubjectScreen({ payload }: { payload: object }) {
120120

121121
const submitSelected = () => {
122122
// Guard against double-tapping: two confirmSubjects calls can otherwise be
123-
// in flight at once, before the backend has advanced the step. The screen
124-
// unmounts on step advancement, so this never needs resetting.
123+
// in flight at once, before the backend has advanced the step. `loading`
124+
// already blocks the click (it sets the underlying disabled attribute), so
125+
// this is a backstop for clicks that reach the host element directly. The
126+
// screen unmounts on step advancement, so neither needs resetting.
125127
if (submitted) return;
126128
setSubmitted(true);
127129

@@ -225,7 +227,8 @@ export function SelectSubjectScreen({ payload }: { payload: object }) {
225227
variant="primary"
226228
icon={ArrowRightIcon}
227229
iconPosition="after"
228-
disabled={selectedParticipantIds.length === 0 || submitted}
230+
disabled={selectedParticipantIds.length === 0}
231+
loading={submitted}
229232
onClick={submitSelected}
230233
>
231234
{t("submit", {

0 commit comments

Comments
 (0)