HomeiOS Developmentios - After transitioning a View, keyboard focus and voice over focus...

ios – After transitioning a View, keyboard focus and voice over focus positions are usually not appropriate


TLDR;
Accessibility focus concern after ingredient transition and animate in swiftUI

Particulars:
In our app we customized backside sheet having a navigation stack inside it and it transition animates like presentation display screen. We face downside with accessibility give attention to components inside it.

If appears like accessibility system of iOS takes the preliminary place of the weather. And if we transition its place (backside to high in our case) it don’t get the brand new positions of ingredient so focus positions are usually not appropriate particularly if it has navigation stack.

@AccessibilityFocusState non-public var focusOnContent: Bool

        ZStack(alignment: .high) {
            NavigationStack {
                // content material
            }

        }
        .zIndex(10)
        .roundedCorner(12, corners: [.topLeft, .topRight])
        .transition(UIAccessibility.isVoiceOverRunning ? .id : .transfer(edge: .backside))
        .animation(.easeInOut(period: 0.3), worth: viewModel.showMenuSheet)
        .onAppear {
            DispatchQueue.fundamental.asyncAfter(deadline: .now() + 0.3) {
                self.focusOnComponent = true
            }
        }

Tried some workaround:

  • Calling totally different UIAccessibility.submit notification after a while.
  • If I take away navigation Stack or sheet animation the whole lot works tremendous.
  • Tried rending navigation stack after a while. This fixes the difficulty however animation appears dangerous (curtain open kind) as components doesn’t transfer up with animation.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments