File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change 3
3
## 2.25.0
4
4
5
5
- Add support for [ Symfony UID] ( https://symfony.com/doc/current/components/uid.html ) hydration/dehydration
6
+ - ` ComponentWithFormTrait ` now correctly checks for a ` TranslatableInterface ` placeholder for ` <select> ` elements
6
7
7
8
## 2.23.0
8
9
Original file line number Diff line number Diff line change 16
16
use Symfony \Component \Form \FormInterface ;
17
17
use Symfony \Component \Form \FormView ;
18
18
use Symfony \Component \HttpKernel \Exception \UnprocessableEntityHttpException ;
19
+ use Symfony \Contracts \Translation \TranslatableInterface ;
19
20
use Symfony \UX \LiveComponent \Attribute \LiveProp ;
20
21
use Symfony \UX \LiveComponent \Attribute \PreReRender ;
21
22
use Symfony \UX \LiveComponent \Util \LiveFormUtility ;
@@ -286,7 +287,8 @@ private function extractFormValues(FormView $formView): array
286
287
)
287
288
&& !$ child ->vars ['expanded ' ] // is a <select> (not a radio/checkbox)
288
289
&& !$ child ->vars ['multiple ' ] // is not multiple
289
- && !\is_string ($ child ->vars ['placeholder ' ]) // has no placeholder (empty string is valid)
290
+ && !\is_string ($ child ->vars ['placeholder ' ]) // has no placeholder (empty string is valid)
291
+ && !$ child ->vars ['placeholder ' ] instanceof TranslatableInterface // has no placeholder (translatable interface is valid)
290
292
) {
291
293
$ choices = $ child ->vars ['preferred_choices ' ] ?: $ child ->vars ['choices ' ]; // preferred_choices has precedence, as they rendered before regular choices
292
294
do {
You can’t perform that action at this time.
0 commit comments