Skip to content

Switcher parameter style works odd (Joomla 4) #20314

@htmgarcia

Description

@htmgarcia

Steps to reproduce the issue

If you are adding a radio parameter using the switcher class (in this case for a template through the file templateDetails.xml)

<field
    name="something"
    type="radio"
    class="switcher"
    default="0"
    label="Something">
        <option value="1">Yes</option>
	<option value="0">No</option>
</field>

Expected result

The switcher should be in gray color when the default value is 0 ("No")
The switcher should be in green color when the default value is 1 ("Yes")

Actual result

The switcher is in green color when the default value is 0 ("No")
screen shot 2018-05-07 at 4 24 55 pm

The switcher is in gray color when the default value is 1 ("Yes")
screen shot 2018-05-07 at 4 25 28 pm

System information (as much as possible)

Chrome Version 66.0.3359.139 (Official Build) (64-bit)
MacOS High Sierra 10.13.4

Additional comments

It seems that the order of the options would make the switcher to works fine:

<option value="0">No</option>
<option value="1">Yes</option>

In the other side, if the options are listed with "1" as first, is when doesn't work:

<option value="1">Yes</option>
<option value="0">No</option>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions