Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render hidden form input fields for Checkbox, Switch and RadioGroup components #3095

Merged
merged 3 commits into from
Apr 11, 2024

Commits on Apr 11, 2024

  1. add overrides prop to internal FormFields

    By default, the hidden form fields render an `<input type="hidden" />`.
    However, we have some components where we explicitly want to change the
    type for example `checkbox` or `radio` types.
    
    I first tried to encode this information in the data itself. That
    requires us to use symbols so that we don't accidentally choose a key
    that actually exists in the data.
    
    An overrides key solves this for our use cases. The component is also
    internal, so nothing is exposed to the user.
    RobinMalfait committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    382a613 View commit details
    Browse the repository at this point in the history
  2. always render hidden form elements

    In case of checkboxes and radio elements, we will only render the hidden
    inputs if:
    1. You pass a `name` prop to make it form-aware
    2. When the checkbox / radio is "checked"
    
    This is now changed to always render the hidden input as long as the
    `name` prop is passed to make it form-aware.
    RobinMalfait committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    93e423b View commit details
    Browse the repository at this point in the history
  3. update changelog

    RobinMalfait committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    7037b35 View commit details
    Browse the repository at this point in the history