No Code Attached Yet a11y bug
avatar brianteeman
brianteeman
25 Jul 2023

Steps to reproduce the issue

With the new plugins installed and enabled open an article, select a schema and check the html

Expected result

Valid markup with no accessibility errors

Actual result

Example from Bookposting

image

Label for non existing input
image

But it shouldnt be a label anyway
The fields in the subform-wrapper must be a fieldset with a legend as the first entry in the fieldset instead of the orphaned label above.

System information (as much as possible)

Additional comments

avatar brianteeman brianteeman - open - 25 Jul 2023
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jul 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Jul 2023
avatar richard67 richard67 - change - 25 Jul 2023
Labels Added: a11y
avatar richard67 richard67 - labeled - 25 Jul 2023
avatar bembelimen
bembelimen - comment - 27 Jul 2023

Is this schemaorg specific or a global bug in Joomla when using subforms?

avatar brianteeman
brianteeman - comment - 27 Jul 2023

It's just bad markup in the xml

avatar brianteeman
brianteeman - comment - 27 Jul 2023

basicaly these are fieldsets not subforms

avatar brianteeman
brianteeman - comment - 28 Jul 2023

Just rechecked and rechecked.
The problem is 100% due to the schema plugin xml. There is no other xml form defintion in Joomla that has "nested" <form> elements.
In fact nested forms are very specifically mentioned

Warning: It's strictly forbidden to nest a form inside another form. Nesting can cause forms to behave unpredictably, so it is a bad idea
source MDN

(just because we call something a subform doesnt mean that it is)

image

avatar brianteeman
brianteeman - comment - 25 Aug 2023

If they would just render as a fieldset then it would be fine. but no matter what I have tried it doesnt render as a fieldset. I must be missing somethign obvious

avatar Fedik
Fedik - comment - 25 Aug 2023

This layout renders a "non multiple" subform: layouts/joomla/form/field/subform/default.php

avatar brianteeman
brianteeman - comment - 25 Aug 2023

yes i see that - which is wrong afaict and it should be a fieldset with a legend - see image above - but whenever I try to add it as a fieldest it doesnt render correctly. I must be missing something

avatar Fedik
Fedik - comment - 25 Aug 2023

The legend will not show up as you expected. It can be only within that layout.

On your screenshot it is a field label, that rendered in label layout.

In result can be:

<label></label> => from field label

<fieldset>            |
   <legend></legend>  | => from field input
</fieldset>           |
avatar brianteeman
brianteeman - comment - 25 Aug 2023

that is what is wrong and breaks accessibility and html standards

avatar Fedik
Fedik - comment - 25 Aug 2023

Following will not work?

<label for="blabla-input"></label> 

<fieldset id="blabla-input">            
   <legend aria-hidden></legend> 
</fieldset> 

If I right remember we use the same for checboxes/radio field fieldset.

avatar brianteeman
brianteeman - comment - 25 Aug 2023

Yes thats one option. The "difference" is that for checkboxes/radio we are creating a fieldset out of a single field. In this case we should be rendering a fieldest containing several fields

avatar Fedik
Fedik - comment - 25 Aug 2023

In theory it should be possible to do oposite: the label is hidden with hiddenLabel="true" in xml, and the legend visible.

avatar brianteeman
brianteeman - comment - 25 Aug 2023

it shouldnt be necessary. we already render multiple fieldsets elsewhere

avatar Hackwar Hackwar - change - 28 Mar 2024
Labels Added: bug
avatar Hackwar Hackwar - labeled - 28 Mar 2024

Add a Comment

Login with GitHub to post a comment