Skip to content

Fix drag-and-drop redordering for question options#2045

Merged
sanason merged 2 commits into
developfrom
fix-question-option-reorder
May 11, 2026
Merged

Fix drag-and-drop redordering for question options#2045
sanason merged 2 commits into
developfrom
fix-question-option-reorder

Conversation

@sanason
Copy link
Copy Markdown
Member

@sanason sanason commented May 11, 2026

See linked issue for description of the problem.

This PR:

  • Adds backend validation to enforce that a reordering must be completely specified - it must assign a unique position to each of a question's options. This prevents ambiguous orderings where, for instance, multiple options have been assigned to position 1.
  • Fixes the front-end code to actually perform drag-and-drop for question options.
  • Initialize event listeners so that drag-and-drop still works after adding or editing a question, without requiring a page reload.
  • Added controller and feature specs.

Manual tests performed:

  • Load the Questions tab for the Kitchen Sink form and test that each of the following question types supports drag-and-drop reordering of question options: radio buttons, dropdown, checkbox, combo box.
  • Drag-and-drop changes are persisted to the database.
  • Within a question option, it is still possible to click on the delete button (to delete the option) and the option label (to update the option text and value).
  • Question option is draggable immediately after being added to an existing question.
  • Question option is draggable immediately after being added to a new question.
  • "Other" option is draggable immediately after being added.
  • Options are draggable after editing a question and then either Saving or Cancelling.
  • Drag and drop reordering of questions still works.

@sanason sanason linked an issue May 11, 2026 that may be closed by this pull request
@sanason sanason assigned sanason and unassigned sanason May 11, 2026
@sanason sanason merged commit 7b398ff into develop May 11, 2026
6 checks passed
@sanason sanason deleted the fix-question-option-reorder branch May 12, 2026 18:27
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.

Fix drag-and-drop reordering for question options

1 participant