ONEAPP-6239 - Loader isActive still showing when false with accessibility

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-01-05 12:45:24 -06:00
parent 44ce29035e
commit 093bd75871

View File

@ -96,6 +96,8 @@ open class Loader: View {
private let rotationLayerName = "rotationAnimation" private let rotationLayerName = "rotationAnimation"
private func startAnimating() { private func startAnimating() {
accessibilityLabel = "Loading" accessibilityLabel = "Loading"
isAccessibilityElement = true
icon.isHidden = false
icon.layer.remove(layerName: rotationLayerName) icon.layer.remove(layerName: rotationLayerName)
let rotation : CABasicAnimation = CABasicAnimation(keyPath: "transform.rotation.z") let rotation : CABasicAnimation = CABasicAnimation(keyPath: "transform.rotation.z")
@ -115,6 +117,8 @@ open class Loader: View {
} }
private func stopAnimating() { private func stopAnimating() {
isAccessibilityElement = false
icon.isHidden = true
icon.layer.removeAnimation(forKey: rotationLayerName) icon.layer.removeAnimation(forKey: rotationLayerName)
loadingTimer?.invalidate() loadingTimer?.invalidate()
loadingTimer = nil loadingTimer = nil