mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 21:03:01 +00:00
fix: Swap order of enabled checkbox and hidden input in custom-feeds
The hidden input with value="false" was rendered before the checkbox, causing request.form.to_dict() to use the hidden input's value instead of the checkbox's "true" value when checked. Fix by rendering the checkbox first, then the hidden fallback input. This ensures that when the checkbox is checked, its "true" value overwrites the hidden input's "false" value in request.form.to_dict(). The hidden input still serves as a fallback to ensure "false" is submitted when the checkbox is unchecked (since unchecked checkboxes don't submit a value).
This commit is contained in:
@@ -259,12 +259,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-3 whitespace-nowrap text-center">
|
<td class="px-4 py-3 whitespace-nowrap text-center">
|
||||||
<input type="hidden" name="{{ full_key }}.{{ item_index }}.enabled" value="false">
|
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
name="{{ full_key }}.{{ item_index }}.enabled"
|
name="{{ full_key }}.{{ item_index }}.enabled"
|
||||||
{% if item.get('enabled', true) %}checked{% endif %}
|
{% if item.get('enabled', true) %}checked{% endif %}
|
||||||
value="true"
|
value="true"
|
||||||
class="h-4 w-4 text-blue-600">
|
class="h-4 w-4 text-blue-600">
|
||||||
|
<input type="hidden" name="{{ full_key }}.{{ item_index }}.enabled" value="false">
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-3 whitespace-nowrap text-center">
|
<td class="px-4 py-3 whitespace-nowrap text-center">
|
||||||
<button type="button"
|
<button type="button"
|
||||||
|
|||||||
Reference in New Issue
Block a user