rss-bridge icon indicating copy to clipboard operation
rss-bridge copied to clipboard

Unchecking a checkbox with defaultValue 'checked' leaves it with checked value

Open wrobelda opened this issue 1 year ago • 1 comments

Describe the bug I am bit puzzled as to how the checkbox PARAMETER is supposed to be used. Per the manual,

checkbox: Must be “checked” to activate the checkbox

It is, therefore, what I am setting my parameter to, so that the checkbox is shown as checked by default. Everything works fine until I actually uncheck it. I can see the parameter is not passed via URL query anymore, which is expected, but the $this->getInput('uncheckedparameter') returns checked value.

So based on that, it is currently impossible to have a checkbox parameter set to 'checked' by default, as no matter what, its value is always resolved to exactly that.

Expected behavior After unchecking a checkbox with a defaultValue set, $this->getInput('uncheckedparameter') should return NULL.

wrobelda avatar Jul 29 '22 13:07 wrobelda

Can confirm this. It's not possible to have a default value of checked for a checkbox.

dvikan avatar Jul 31 '22 03:07 dvikan

Has there been any progress on this?

There are multiple bridges that are affected by this, though I foresee no impact to already subscribed feeds if a fix is implemented, since the checkbox is already selected by default due to this bug.

Looking into the issue, the unchecked checkbox with 'defaultValue' => 'checked' would return 'checked', instead of NULL or false;

Input: image

Output:

ON: 'checked'; 
OFF: true; 

mruac avatar Sep 07 '23 11:09 mruac