Lukasz Lenart created WW-5780:
---------------------------------
Summary: html5 theme checkboxlist never closes the checkbox input
element
Key: WW-5780
URL: https://issues.apache.org/jira/browse/WW-5780
Project: Struts 2
Issue Type: Bug
Components: Plugin - Tags
Reporter: Lukasz Lenart
Fix For: 7.5.0
The {{html5}} theme template {{template/html5/checkboxlist.ftl}} emits each
{{<input type="checkbox" ...}} without a closing {{/>}} — the
{{dynamic-attributes.ftl}} include is followed directly by {{<label}}.
Rendering {{<s:checkboxlist theme="html5" name="collection" list="list"
listKey="top[0]" listValue="top[1]" cssClass="myClass"
cssStyle="width:150px"/>}} produces:
{code:html}<input type="checkbox" name="collection" value="hello"
id="collection-1" class="myClass" style="width:150px" class="myClass"
style="width:150px"<label for="collection-1" class="checkboxLabel">world</label>
{code}
The browser parses {{<label}}, {{for}} and {{class}} as attribute names of the
input, so no {{label}} element is created: clicking the item text does not
toggle the checkbox and assistive technology loses the label.
Present since the html5 theme was added (WW-5444), i.e. released in 7.2.0.
{{CheckboxListTest.testGenericHtml5}} only checks that expected substrings
appear, so it does not catch malformed markup.
Fix: close the input as {{template/html5/radiomap.ftl}} already does, and add a
full expected-output fixture for the html5 checkboxlist.
The duplicated {{class}}/{{style}} attributes in the output above are tracked
separately.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)