Merge pull request #9427 from ramono/role-option

Add "option" to list elements that belong to "listbox"
This commit is contained in:
Garion Herman 2020-03-16 17:12:14 +13:00 committed by GitHub
commit 8a64101621
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 2 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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>

View File

@ -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>