title: SwiftUI AccessibilityHidden Still Selectable
body: <p>Working on all things accessibility related and found that .accessibilityHidden(true) doesn't seem to work correctly. Even though VO doesn't read anything, it still shows the white box as you swipe around the page. The only way I've solved this is to put a VStack around the entire thing and then it seems to be fine, however it truncates the welcomeBodyText in simulator but not on a real device, which is worrying because I need to ensure that this works across all devices.</p>
  <p>As the HeaderNav just shows the logo and company name, there is no reason to have it selectable, nor read out on every single page, so I wanted to completely hide it from VO and immediately jump to reading the welcomeHeaderText followed by the welcomeBodyText.</p>
  <p><strong>HeaderNav.swift</strong></p>
  <pre><code>import SwiftUI
  
  struct HeaderNav: View {
      var body: some View {
          VStack {
              Spacer()
                  .frame(minHeight: 26, idealHeight: 26, maxHeight: 26)
                  .fixedSize()
              HStack(spacing: 16) {
                  Spacer()
                  Image(decorative: &quot;LogoHeader&quot;)
                      .resizable()
                      .aspectRatio(contentMode: .fit)
                      .frame(width: 70)
  
                  Text(LocalizationStrings.companyName)
                      .fontWeight(.light)
                      .foregroundColor(Color(&quot;WhiteText&quot;))
                      .font(.system(size: 34))
                      .tracking(0.8)
                  Spacer()
              } // End HStack
              .accessibilityElement(children: .ignore)
              .accessibilityLabel(LocalizationStrings.companyName)
          } // End VStack
      }
  }
  </code></pre>
  <p><strong>WelcomeTextView.swift</strong></p>
  <pre><code>import SwiftUI
  
  struct WelcomeTextView: View {
      var body: some View {
          Section {
  
              VStack { // This is what needed to be added to make it work but causes issues in the simulator
                  HeaderNav()
                      .accessibilityHidden(true)
  
                  VStack(spacing: 10) {
                      Group {
                          HeaderText(text: LocalizationStrings.welcomeHeaderText)
                          BodyText(text: LocalizationStrings.welcomeBodyText)
                      } // End Group (Page Description)
                      .pageDescr()
  
                  } // End VStack
              } // End VStack to make it work
              .accessibilityElement(children: .combine)
          } // End Section
          .listRowBackground(Color(&quot;mainbkg&quot;))
          .listRowSeparator(.hidden)
      }
  }
  </code></pre>