Visitar URL original
fix: support multiselect in form data by jasonsaayman · Pull Request #10676 · axios/axios · GitHub
Skip to content

fix: support multiselect in form data - #10676

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

jasonsaayman merged 1 commit into
v1.xfrom
fix/7365-support-multi-select-in-form-data

Conversation

@jasonsaayman

@jasonsaayman jasonsaayman commented Apr 9, 2026 •

Copy link
Copy Markdown
Member

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.

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

Copy link
Copy Markdown
Contributor

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
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.

axios support select multiple has bug

1 participant