mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Add "option" to list elements that belong to "listbox"
The accessibility attribute `role="listbox"` requires its immediate children to be set as `role="option"`, currently they don't have this option and accessibility tests are failing.
This commit is contained in:
parent
667495eaf9
commit
9c7eac481e
@ -90,6 +90,7 @@ class CheckboxSetField extends MultiSelectField
|
||||
$options->push(new ArrayData(array(
|
||||
'ID' => $itemID,
|
||||
'Class' => $extraClass,
|
||||
'Role' => 'option',
|
||||
'Name' => "{$this->name}[{$itemValue}]",
|
||||
'Value' => $itemValue,
|
||||
'Title' => $title,
|
||||
|
@ -72,6 +72,7 @@ class OptionsetField extends SingleSelectField
|
||||
return new ArrayData(array(
|
||||
'ID' => $this->getOptionID($value),
|
||||
'Class' => $this->getOptionClass($value, $odd),
|
||||
'Role' => 'option',
|
||||
'Name' => $this->getOptionName(),
|
||||
'Value' => $value,
|
||||
'Title' => $title,
|
||||
|
@ -1,7 +1,7 @@
|
||||
<ul $AttributesHTML>
|
||||
<% if $Options.Count %>
|
||||
<% loop $Options %>
|
||||
<li class="$Class">
|
||||
<li class="$Class" role="$Role">
|
||||
<input id="$ID" class="checkbox" name="$Name" type="checkbox" value="$Value.ATT"<% if $isChecked %> checked="checked"<% end_if %><% if $isDisabled %> disabled="disabled"<% end_if %> />
|
||||
<label for="$ID">$Title</label>
|
||||
</li>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<ul $AttributesHTML>
|
||||
<% loop $Options %>
|
||||
<li class="$Class">
|
||||
<li class="$Class" role="$Role">
|
||||
<input id="$ID" class="radio" name="$Name" type="radio" value="$Value"<% if $isChecked %> checked<% end_if %><% if $isDisabled %> disabled<% end_if %> <% if $Up.Required %>required<% end_if %> />
|
||||
<label for="$ID">$Title</label>
|
||||
</li>
|
||||
|
Loading…
Reference in New Issue
Block a user