Skip to content

2.5.2/fix/default external id+fixes - #1702

Merged
jochenklar merged 3 commits into
2.5.2/fix/default-external-idfrom
2.5.2/fix/default-external-id+fixes
Aug 6, 2026
Merged

2.5.2/fix/default external id+fixes#1702
jochenklar merged 3 commits into
2.5.2/fix/default-external-idfrom
2.5.2/fix/default-external-id+fixes

Conversation

@MyPyDavid

@MyPyDavid MyPyDavid commented Aug 3, 2026

Copy link
Copy Markdown
Member

I was testing around with the collection question multi select i.c.w. the ROR provider and found some quirks.
Here are some possible fixes for #1691

Quirks and changes:

1. Fix pending state when deleting unsaved values

The pending state got stuck in a forever-loop after try to delete some value

rdmo/projects/assets/js/interview/actions/interviewActions.js
  • Only the removeFromPending(pendingId) hunk in deleteValue.
dispatch(removeFromPending(pendingId))

2. Preserve unsaved values during provider refreshes

 rdmo/projects/assets/js/interview/actions/interviewActions.js
  • Add preserveUnsaved handling to fetchValues.
  • Preserve and deduplicate local unsaved values.
  • Use it after storing, copying, or deleting values when a provider requires refresh.

3. Preserve defaults when adding collection values

What I found:

When I see the first default option already filled in and want to add another value (via AddValue) , then I can search and select it but it will replace the first value instead adding it to the collection of that question.

It happens when the plugin has refresh = True, so (has_refresh: true).

The fix what Codex found was:

AddValue was already creating a second temporary value at the next collection_index and marking it with focus: true. The problem was that SelectInput ignored this focus marker, unlike text inputs. The still-focused default select therefore received the next selection, making it appear to be replaced.
SelectInput now attaches the existing focus hook to every React Select variant. After clicking Add, keyboard input goes to the newly added select, preserving the default as collection index 0 and storing the new selection at index 1.

  rdmo/projects/assets/js/interview/components/main/question/QuestionAddValue.js \
  rdmo/projects/assets/js/interview/components/main/widget/DateWidget.js \
  rdmo/projects/assets/js/interview/components/main/widget/FileWidget.js \
  rdmo/projects/assets/js/interview/components/main/widget/RadioWidget.js \
  rdmo/projects/assets/js/interview/components/main/widget/RangeWidget.js \
  rdmo/projects/assets/js/interview/components/main/widget/SelectWidget.js \
  rdmo/projects/assets/js/interview/components/main/widget/TextWidget.js \
  rdmo/projects/assets/js/interview/components/main/widget/TextareaWidget.js \
  rdmo/projects/assets/js/interview/components/main/widget/YesNoWidget.js
  • All widget wrapper files passing updateValue.
  • Persist an existing untouched default before adding another value.
  • Reapply the configured default when adding the first value to an empty collection.

4. Focus newly added select values

So that the cursor jumps right into the search box after opening/clicking on it.

  rdmo/projects/assets/js/interview/components/main/widget/SelectInput.js
  • Add autoFocus: value.focus.
  • A comment typo correction.

Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage is 95.118%2.5.2/fix/default-external-id+fixes into 2.5.2/fix/default-external-id. No base build found for 2.5.2/fix/default-external-id.

@MyPyDavid

Copy link
Copy Markdown
Member Author

I've added the quirks that I found and my changes to the description

})
}

const defaultValue = values.find((value) => isDefaultValue(question, value))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get most changes now, thanks for the explanation. I don't understand this update, though. I seems to fix the unit and value type for unsaved default values, which is not nessasary. I will integrate the rest in my PR. We can talk more next week.

@jochenklar
jochenklar merged commit f2a9614 into 2.5.2/fix/default-external-id Aug 6, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants