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