Skip to content

fix: support multiselect in form data#10676

Merged
jasonsaayman merged 1 commit intov1.xfrom
fix/7365-support-multi-select-in-form-data
Apr 9, 2026
Merged

fix: support multiselect in form data#10676
jasonsaayman merged 1 commit intov1.xfrom
fix/7365-support-multi-select-in-form-data

Conversation

@jasonsaayman
Copy link
Copy Markdown
Member

@jasonsaayman jasonsaayman commented Apr 9, 2026

Closes #7365


Summary by cubic

Fixes formDataToJSON so repeated FormData fields (e.g., multi-selects) serialize into flat arrays instead of creating nested arrays. Works for both top-level and nested keys.

Description

  • Change: when a key already has an array value, append via concat instead of wrapping again.
  • Reason: repeated values with 3+ entries were producing nested arrays like [[a, b], c].
  • Context: supports multi-select inputs and nested paths like foo[bar], while preserving existing array-bracket behavior.

Testing

  • Added two unit tests in tests/unit/helpers/formDataToJSON.test.js:
    • Repeated top-level key (3 values) stays flat.
    • Repeated nested key foo[bar] (3 values) stays flat.

Written for commit 6909861. Summary will update on new commits.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@jasonsaayman jasonsaayman merged commit 0912bde into v1.x Apr 9, 2026
26 checks passed
@jasonsaayman jasonsaayman deleted the fix/7365-support-multi-select-in-form-data branch April 9, 2026 15:31
@jasonsaayman jasonsaayman added priority::medium A medium priority commit::fix The PR is related to a bugfix labels Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit::fix The PR is related to a bugfix priority::medium A medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

axios support select multiple has bug

1 participant