added temp fix for updated operation type logic

This commit is contained in:
Krishna Kishore Bandaru 2023-07-06 20:23:43 +05:30
parent 06e4faab5e
commit 21a45203a3

View File

@ -175,12 +175,13 @@ extension AccessibilityHandler: MVMCorePresentationDelegateProtocol {
public func navigationController(_ navigationController: UINavigationController, displayedViewController viewController: UIViewController) {
guard UIAccessibility.isVoiceOverRunning,
canPostAccessbilityNotification(for: viewController) else { return }
var navigationOperationType: NavigationType = .push
//TODO: - For Tabbar change: adding 1.5 sec delay to shift focus to the top. for Temp fix added to check on childern count
/*var navigationOperationType: NavigationType = .push
if let presentationStyle = delegate?.loadObject??.pageJSON?.optionalStringForKey(KeyPresentationStyle) ?? delegate?.loadObject??.requestParameters?.actionMap?.optionalStringForKey(KeyPresentationStyle), presentationStyle == "root" {
navigationOperationType = .set //TODO: - For Tabbar change: adding 1.5 sec delay to shift focus to the top.
}
navigationOperationType = .set
}*/
let accessbilityElement = getAccessbilityFocusedElement()
post(notification: navigationOperationType == .set ? .controllerChanged : .layoutChanged, argument: accessbilityElement ?? getFirstFocusedElementOnScreen())
post(notification: navigationController.children.count == 1 ? .controllerChanged : .layoutChanged, argument: accessbilityElement ?? getFirstFocusedElementOnScreen())
}
}