I am facing scrolling issue while applying accessibility.
:
:
:
.modifier(if: adjustableAccessibilityScrollView) {
$0.accessibilityElement()
.accessibilityLabel(Text(viewModel.accessibilityFormLabel))
.accessibilityValue(Text(String(viewModel.chips[selectedChipIndex].text)))
.accessibilityAdjustableAction { direction in
switch direction {
case .increment:
guard viewModel.chips.count - 1 > selectedChipIndex else { break }
selectedChipIndex += 1
viewModel.selectChip(index: selectedChipIndex)
proxy.scrollTo(selectedChipIndex, anchor: .center)
case .decrement:
guard selectedChipIndex > 0 else { break }
selectedChipIndex -= 1
viewModel.selectChip(index: selectedChipIndex)
proxy.scrollTo(selectedChipIndex, anchor: .center)
@unknown default:
break
}
}
.accessibilityAction(.default) {
viewModel.selectChip(index: selectedChipIndex)
}
}