Skip to content

FOLLOW-UP: Consider always-array mode for checkbox serialization (from PR #78) #79

@adnaan

Description

@adnaan

Context

This follow-up task was identified during the review of PR #78.

Source PR: #78
PR Title: fix(checkbox): send array of values for multiple same-name checkboxes
Suggested by: @claude[bot]
Comment type: PR comment

Task Description

Consider adding an opt-in "always-array" mode for checkbox serialization. Currently, the type of a checkbox field depends on how many checkboxes share that name in the DOM:

  • 1 checkbox → true/false (boolean)
  • 2+ checkboxes → string[] (array of checked values)

If a form evolves from one checkbox to two (adding an option), the backend type silently changes. An opt-in attribute (e.g., lvt-checkbox:array) could let developers explicitly request array serialization for single checkboxes, giving backends a consistent type contract.

Original Comment

The single vs. multi-group branching means the type of a field on the server depends on how many checkboxes share that name in the DOM — not on the data itself. If a form evolves from one checkbox to two (adding an option), the backend type silently changes. Consider documenting whether a "always-array" variant is planned for consistency.


This issue was automatically created by prmonitor from PR review comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-upFollow-up task from PR reviewfrom-reviewIssue originated from PR review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions