Open NicoHaase opened 9 months ago
Bizarre - I've just chased down this exact same issue, and here it is top of the list :)
All I have to add is that it doesn't matter about pre-selected values. On a completely fresh form this bug also prevents me from selecting a checkbox/radio with a non-truthy value.
I had a ChoiceType form with two radios - {"Yes": "1", "No": "0"} - and trying to submit the form via Panther with {"confirm": "0"} ended up with it selecting "Yes" :D
(A workaround for my issue was to change my form to use the "choice_value" option to alter the strings that were being outputted on the HTML side whilst not changing the data values that the form returned via getData())
In a form in my project, a form holds two radio buttons for the field
transfer
with values0
and1
. When the button with value1
is pre-selected, I cannot change that.$form['transfer']->setValue('0');
does nothing, asSymfony\Component\Panther\WebDriver\WebDriverCheckbox::getRelatedElements
does not yield any field selector when$value = '0'
I could get this working when modifing the first line of that method from
to