Skip to content

Commit

Permalink
Fix missing check on choices
Browse files Browse the repository at this point in the history
  • Loading branch information
smnandre authored Jan 10, 2025
1 parent cd353fc commit 29a442f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/LiveComponent/src/ComponentWithFormTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ private function extractFormValues(FormView $formView): array
// When no option is selected, browsers send the value of the first
// option, when the following conditions are met:
if (
isset($child->vars['choices']) // has defined choices
\array_key_exists('choices', $child->vars)
&& $child->vars['choices'] // has defined choices
&& $child->vars['required'] // is required
&& !$child->vars['disabled'] // is not disabled
&& '' === $child->vars['value'] // has no value set ("0" can be a value)
Expand Down

0 comments on commit 29a442f

Please sign in to comment.