DoctrineModule icon indicating copy to clipboard operation
DoctrineModule copied to clipboard

ObjectSelect doesn't select default value if "size" attribute is used

Open tad3j opened this issue 11 years ago • 1 comments

When I use ObjectSelect in combination with select's "size" (greater than 1), none of the options are selected inside select element when the value is null, even if "display_empty_item" is set to true.

When form validation fails and form is reloaded, the options are selected as they should be, so it looks like the problem only exists when select value is null.

Is this normal behavior?

Btw, if I use "$form->get('fieldset')->get('element')->setValue('');" after binding the empty option is selected as expected.

tad3j avatar Apr 15 '14 21:04 tad3j

@tad3j can you write a failing test for this?

Ocramius avatar Apr 16 '14 10:04 Ocramius