updated for item count in groups
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
d0459cfb7d
commit
a3dfa2efed
@ -38,13 +38,14 @@ open class CheckboxGroup: SelectorGroupHandlerBase<CheckboxItem> {
|
||||
public var selectorModels: [CheckboxModel]? {
|
||||
didSet {
|
||||
if let selectorModels {
|
||||
selectorViews = selectorModels.map { model in
|
||||
selectorViews = selectorModels.enumerated().map { index, model in
|
||||
return CheckboxItem().with {
|
||||
$0.disabled = model.disabled
|
||||
$0.surface = model.surface
|
||||
$0.inputId = model.inputId
|
||||
$0.value = model.value
|
||||
$0.accessibilityLabel = model.accessibileText
|
||||
$0.accessibilityValue = "item \(index+1) of \(selectorModels.count)"
|
||||
$0.labelText = model.labelText
|
||||
$0.labelTextAttributes = model.labelTextAttributes
|
||||
$0.childText = model.childText
|
||||
|
||||
@ -33,13 +33,14 @@ open class RadioButtonGroup: SelectorGroupSelectedHandlerBase<RadioButtonItem> {
|
||||
public var selectorModels: [RadioButtonModel]? {
|
||||
didSet {
|
||||
if let selectorModels {
|
||||
selectorViews = selectorModels.map { model in
|
||||
selectorViews = selectorModels.enumerated().map { index, model in
|
||||
return RadioButtonItem().with {
|
||||
$0.disabled = model.disabled
|
||||
$0.surface = model.surface
|
||||
$0.inputId = model.inputId
|
||||
$0.value = model.value
|
||||
$0.accessibilityLabel = model.accessibileText
|
||||
$0.accessibilityValue = "item \(index+1) of \(selectorModels.count)"
|
||||
$0.labelText = model.labelText
|
||||
$0.labelTextAttributes = model.labelTextAttributes
|
||||
$0.childText = model.childText
|
||||
|
||||
Loading…
Reference in New Issue
Block a user