react / react/react-native

Accessibility loses focus on horizontal scroll

Ouverte
#41,566 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Issue: Author Provided Repro Needs: Triage :mag:
Langage dominant
C++
Étoiles
127k
Forks
25.3k
Merge moyen
1 j 23 h
PR mergées (30 j)
4

Description

Description

I have this issue that I can't seem to find anyone else talking about having the same problem. Basically, if you have the screen reader enabled on iOS and long scroll (so the tap tap tap happens), on an inaccessible container, then the screen reader ends up focusing on the container. Weirdly, the outline for the screen reader stays where you were. Scrolling backwards does go back up from the bottom through the elements.

I've started a basic React Native app and the same thing happens. In the attached videos, I scroll just enough to get the long horizontal tap scroll engaged, and then the screen reader loses focus and is focused on the bottom of the screen. I then swipe right, and it gives the sort of "end of page" sound even though visually, I'm on the first element still. I can then swipe left, and be back into the content but at the bottom of the page.

Any help would be amazing - is there just something I am missing about ensuring content is not accessible?

https://github.com/facebook/react-native/assets/7016167/3769d5b3-a129-4f29-acc5-a3ae10b14677

My modified and very bare bones App.tsx from the default new React Native app

function App(): JSX.Element {
  const isDarkMode = useColorScheme() === 'dark';

  const backgroundStyle = {
    backgroundColor: 'gray',
    flex: 1, // happens with or without the flex here
  };

  return (
    <SafeAreaView
      style={backgroundStyle}
      accessible={false}
      importantForAccessibility="no">
      <ScrollView
        contentInsetAdjustmentBehavior="automatic"
        style={backgroundStyle}
        accessible={false}
        importantForAccessibility="no"
        horizontal={false}>
        <Header />
        <View
          style={{
            backgroundColor: isDarkMode ? Colors.black : Colors.white,
          }}
          accessible={false}
          importantForAccessibility="no">
          <Section title="Step One">
            Edit <Text style={styles.highlight}>App.tsx</Text> to change this
            screen and then come back to see your edits.
          </Section>
        </View>
      </ScrollView>
    </SafeAreaView>
  );
}

React Native Version

0.72.7

Output of npx react-native info
System:
  OS: macOS 13.4.1
  CPU: (8) arm64 Apple M1 Pro
  Memory: 65.53 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.17.0
    path: ~/.nvm/versions/node/v18.17.0/bin/node
  Yarn:
    version: 1.22.19
    path: ~/.nvm/versions/node/v18.17.0/bin/yarn
  npm:
    version: 9.6.7
    path: ~/.nvm/versions/node/v18.17.0/bin/npm
  Watchman:
    version: 2023.09.25.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.11.3
    path: /Users/dan/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.1
      - iOS 16.1
      - macOS 13.0
      - tvOS 16.1
      - watchOS 9.1
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10671973
  Xcode:
    version: 14.1/14B47
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.17
    path: /usr/bin/javac
  Ruby:
    version: 2.7.5
    path: /Users/dlinds/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.7
    wanted: 0.72.7
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to reproduce
  1. Create a new React Native app npx react-native@latest init ScreenReaderTest
  2. Remove enough content from the body of App() so that the content doesn't reach the bottom of the screen
  3. Make everything inaccessible except for the Text elements
  4. Build the app to a physical iOS device
  5. Select the first Text element on the screen
  6. Engage the horizontal scroll slide gesture at the bottom of the screen, you should hear the multi tap sound
    • even a longer slide can engage it
  7. The screen reader outline will still be on the first element, but you can't swipe to the next element
  • You can however swipe backwards to move upwards on the page, as the focus is now at the bottom of the screen
Snack, screenshot, or link to a repository

https://snack.expo.dev/@dlinds-1/grounded-blue-churros

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par le Snack lié et la reproduction minimale dans App.tsx, puis exécutez-la sur un appareil iOS physique avec VoiceOver et suivez les étapes indiquées de défilement horizontal. Comparez le focus d’accessibilité avec le contour visible avant et après le geste ; le travail est considéré comme terminé lorsque le comportement du focus est corrigé ou que la limitation et la configuration concernée sont clairement documentées.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
ios, react-native, typescript
Domaine
accessibility, mobile
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.