User tests: Successful: Unsuccessful:
When adjusting a J3 extension to the new J4 UI style, we face the issue that in J3 the radio options in the XML are usually ordered with values descending (so "Yes" is defined first and appears left), while the switcher expects the options ascending (so "Yes" is defined last and appears right).
This is quite a bit of work which we could ease by adding one line into the switcher JLayout.
Since the switcher looks quite unexpected with "wrong" ordering, I don't see a disadvantage in forcing the "correct" ordering. But maybe I miss a usecase where an inversed order would be desired.
This PR automatically orders the switcher options, so it doesn't matter in which order they are written in the XML.
Change the order of the options of a radio switcher field (eg in /administrator/components/com_content/config.xml) and check how the switcher appears (in this example in the article manager options).
If there is a documentation on this switcher, it should be added that the order of the options is ignored.
Status | New | ⇒ | Pending |
Category | ⇒ | Layout |
Hmm, is there a usecase where you would not have 0/1 values in a switcher?
After all the switcher only makes sense for "No/Yes" or "Hide/Show" type parameters.
But yeah, that would make this PR bad idea.
yes there are a lot of places where the values are not 0/1 currently
Ok, then we can close this. Was worth a shot
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-01-27 12:11:05 |
Closed_By | ⇒ | Bakual | |
Labels |
Added:
?
|
Switcher is not limited to 0/1 or to integer values.