Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: reactive-python/reactpy-django
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1097ac3
Choose a base ref
...
head repository: reactive-python/reactpy-django
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 143ee94
Choose a head ref
  • 6 commits
  • 7 files changed
  • 1 contributor

Commits on Jul 19, 2026

  1. Fix #270: Preserve duplicate FormData keys for MultipleChoiceField/Mo…

    …delMultipleChoiceField
    
    - Updated `components.ts` to accumulate duplicate FormData entries into arrays
      instead of silently dropping duplicates (as Object.fromEntries would do).
    - Updated `utils.py` convert_form_fields() to normalize MultipleChoiceField
      and ModelMultipleChoiceField values (absent/None -> empty list, single -> array).
    - Updated test forms to include MultipleChoiceField and
      ModelMultipleChoiceField in BasicForm and BootstrapForm for regression coverage.
    User
    User committed Jul 19, 2026
    Configuration menu
    Copy the full SHA
    6ee64b3 View commit details
    Browse the repository at this point in the history
  2. Fix formatting and test assertion for #270

    User
    User committed Jul 19, 2026
    Configuration menu
    Copy the full SHA
    0fb70a5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    99fc27c View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2026

  1. Add unit tests for convert_form_fields and explicit multi-select roun…

    …d-trip assertions
    
    Following code review suggestions for PR #298:
    - New test_forms_utils.py: 10 unit tests covering None->[], single->[value],
      list->unchanged for MultipleChoiceField, ModelMultipleChoiceField,
      BooleanField/NullBooleanField, and CharField pass-through.
    - test_form_basic: explicit input_value assertions on multi-select and
      model multi-select fields after successful form submission, proving
      the FormData duplicate-key fix works end-to-end.
    - Fix pre-existing ruff import ordering issue in utils.py
    User
    User committed Jul 20, 2026
    Configuration menu
    Copy the full SHA
    3f59f80 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2026

  1. Fix #270: Keep selected on option elements for Preact re-render compat

    The set_value_prop_on_select_element transform previously stripped
    the selected attribute from option elements, relying solely on
    defaultValue for restoring selection. Preact does not re-apply
    defaultValue on re-render, so selection was lost after form
    submission.
    
    Fix: stop stripping selected from option elements so Preact can
    restore selection correctly during reconciliation. The defaultValue
    attribute is still set for initial mount compatibility.
    
    Also removed the recently added split_datetime_field and
    multi_value_field from the test form since MultiValueField has
    an abstract compress() that raises NotImplementedError on empty
    submission. Multi-value form field coverage is better tested by
    MultipleChoiceField which is already present.
    User
    User committed Jul 21, 2026
    Configuration menu
    Copy the full SHA
    37fe051 View commit details
    Browse the repository at this point in the history
  2. Force form content remount when submitted data changes

    Preact/React does not reliably restore <select multiple> selection
    state during in-place reconciliation of option children. Force a
    complete unmount/remount of the <form> element by using a volatile
    React key that increments each time submitted_data triggers a
    re-render.
    
    This ensures defaultValue is applied on mount and that the DOM
    select element starts fresh with the correct selection.
    User
    User committed Jul 21, 2026
    Configuration menu
    Copy the full SHA
    143ee94 View commit details
    Browse the repository at this point in the history
Loading