🩺 v0.20.1 — Grouped Select Fix
What's New
Nothing new in this patch release.
What Changed
Form::SelectComponent — grouped detection fix
The grouped? auto-detection method incorrectly identified flat Hash choices (e.g. { 'admin' => 'admin', 'editor' => 'editor' }) as grouped options. This caused simple key/value hashes to be rendered as <optgroup> structures, breaking the select display. The detection now verifies that hash values are arrays before treating the choices as grouped.
<%= midwest_select(name: :role, label: "Role", choices: { 'admin' => 'admin', 'editor' => 'editor', 'viewer' => 'viewer'}) %>What Was Removed
Nothing removed.
Dev Process
Regression test
A new test_grouped_not_detected_from_flat_hash test case confirms that flat Hash choices are not misidentified as grouped options.
Gemfile lock updates
All four test-matrix gemfile locks (Rails 7, Rails 8, Bridgetown v1, Bridgetown v2) updated to reflect the v0.20.0 gem version.