VoiceOver/TalkBack items inside Carousel/Flatlist

Offen
#321 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
react-native, typescript

Rechercherichtung

Beginne damit, das für Carousel und FlatList beschriebene VoiceOver/TalkBack-Verhalten anhand des Beispiels im Issue zu reproduzieren. Verfolge das relevante React Native-Barrierefreiheitsverhalten und ermittle, wie fokussierte Carousel-Elemente ihren Inhalt offenlegen sollten, während die Inkrement-/Dekrementnavigation erhalten bleibt; als erledigt gilt die Aufgabe, wenn jedes fokussierte Element auf beiden Plattformen barrierefrei gelesen und navigiert werden kann.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Is there an existing issue for this?
  • I have searched the existing issues
Code of Conduct
  • I agree to follow this project's Code of Conduct
Question

Hello, love your project! Although I can't find the way to VoiceOver items inside the Carousel. It captures the entire carousel and says that user has to swipe up or down to navigate through the carousel but in my opinion it would be nice to read the content of the focused item. Something like this:


import { Carousel } from '@react-native-ama/extras';
import { Text } from '@react-native-ama/react-native';
import { View } from 'react-native';

const Component = () => {
  const data = [
    { header: 'Title 1', text: 'Text 1' },
    { header: 'Title 2', text: 'Text 2' },
    { header: 'Title 3', text: 'Text 3' },
  ];
  const flatListRef = React.useRef<FlatList<(typeof data)[number]>>(null);

  const renderItem: ListRenderItem<(typeof data)[number]> = ({ item }) => {
    return (
      <View>
        <Text accessibilityRole="header">item.header<Text />
        <Text accessibilityRole="summary">item.text<Text />
      <View />
    );
  };

  return (
    <FlatList
      ref={flatListRef}
      data={data}
      renderItem={renderItem}
      accessible={true}
      accessibilityLabel="Carousel"
      accessibilityRole="adjustable"
      accessibilityActions={[{ name: 'increment' }, { name: 'decrement' }]}
      onAccessibilityAction={(event: AccessibilityActionEvent) => {
        const value = event.nativeEvent.actionName === 'increment' ? 1 : -1;
        const newIndex = carouselIndexForScreenReader.current + value;

        carouselIndexForScreenReader.current = clamp(newIndex, 0, data.length - 1);
        flatListRef.current?.scrollToIndex({
          index: carouselIndexForScreenReader.current,
        });
      }}
    />
  );
};
Vorherrschende Sprache
TypeScript
Sterne
295
Forks
22
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus FormidableLabs/react-native-ama

Alle Issues in FormidableLabs/react-native-ama

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.