Skip to content

[4.0] Use layout attribute to set field layout#26214

Merged
rdeutz merged 22 commits intojoomla:4.0-devfrom
SharkyKZ:j4/form/Switcher
Feb 11, 2020
Merged

[4.0] Use layout attribute to set field layout#26214
rdeutz merged 22 commits intojoomla:4.0-devfrom
SharkyKZ:j4/form/Switcher

Conversation

@SharkyKZ
Copy link
Copy Markdown
Contributor

@SharkyKZ SharkyKZ commented Sep 8, 2019

Summary of Changes

Use layout attribute to set layout in Joomla\CMS\Form\Field\RadioField.

Testing Instructions

View some forms contain "switcher" fields.

Expected result

Works like before.

Documentation Changes Required

Form fields using switcher class need to be updated to use joomla.form.field.radio.switcher layout instead.

@brianteeman
Copy link
Copy Markdown
Contributor

I have tested this item 🔴 unsuccessfully on 3fbc5c3

The label is now doubled
The accessibility is now brokenn


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26214.

@SharkyKZ
Copy link
Copy Markdown
Contributor Author

SharkyKZ commented Sep 8, 2019

In which form is that?

@brianteeman
Copy link
Copy Markdown
Contributor

every form

@SharkyKZ
Copy link
Copy Markdown
Contributor Author

SharkyKZ commented Sep 8, 2019

I can't reproduce your results.

@brianteeman
Copy link
Copy Markdown
Contributor

I tested it twice

@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented Sep 10, 2019

hmm looks good to me.

without the patch
image

with the patch
image

How can we reproduce the issue you mention? Or I'm missing something here?

@brianteeman
Copy link
Copy Markdown
Contributor

all i did was apply the PR with patchtester

after

image

before

image

@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented Sep 10, 2019

hmm i have now looked into the screenshots more deeply. I have marked the differences, i found on mine. Does the additional for="jform_link_titles" break accessibility? Maybe I just not getting what the issue is as it seams to me that the label is there before and after two times, on both my and your screenshots.

after
image

before
image

@SharkyKZ
Copy link
Copy Markdown
Contributor Author

I'll revert the related change.

@SharkyKZ
Copy link
Copy Markdown
Contributor Author

We can't even use hiddenLabel attribute to actually hide labels anymore 🤷‍♂ .

@SharkyKZ
Copy link
Copy Markdown
Contributor Author

Test again please.

@brianteeman
Copy link
Copy Markdown
Contributor

brianteeman commented Sep 10, 2019

Tried again with a pure git checkout instead of patchtester - dont get the double anymore but there is an empty div now

after

image

before

image

Otherwise its ok

@SharkyKZ
Copy link
Copy Markdown
Contributor Author

Out of scope of this PR. Can happen with other fields because main layout doesn't check for empty input/label.

@brianteeman
Copy link
Copy Markdown
Contributor

As its a change in behaviour created by this PR I dont see how its out of scope

@SharkyKZ
Copy link
Copy Markdown
Contributor Author

This behavior is not specific to this field. Any field that returns an empty string in getLabel() or getInput() methods is going to cause empty divs to be rendered , e.g.

<field
	name="whatever"
	type="note"
/>

Outputs:

<div class="control-group">
	<div class="control-label"></div>
	<div class="controls">
			</div>
	</div>

If it was my call, I'd just drop all these workarounds and have #25085 reverted. It was done with good intentions but with wrong assumptions that the labels can only be hidden for cosmetic purposes.

@Quy
Copy link
Copy Markdown
Contributor

Quy commented Feb 7, 2020

Please fix conflicts.

@Quy
Copy link
Copy Markdown
Contributor

Quy commented Feb 7, 2020

I have tested this item ✅ successfully on bd7ff1b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26214.

1 similar comment
@jwaisner
Copy link
Copy Markdown
Member

I have tested this item ✅ successfully on bd7ff1b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26214.

@jwaisner
Copy link
Copy Markdown
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26214.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Feb 10, 2020
@rdeutz rdeutz merged commit c26d57b into joomla:4.0-dev Feb 11, 2020
@rdeutz rdeutz added this to the Joomla 4.0 milestone Feb 11, 2020
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants