react-native-collapsible-tab-view icon indicating copy to clipboard operation
react-native-collapsible-tab-view copied to clipboard

AccessibilityState support needed in MaterialTabBar

Open kashmiry opened this issue 1 year ago • 0 comments

Feature request

Currently, the MaterialTabBar component does not support setting the accessibilityState for the tab items. This is crucial for accessibility(voice over) as it helps screen readers identify the selected tab.

Current behavior

No accessibilityState is assigned.

My current container looks like this:

<Tabs.Container lazy
    renderHeader={() => !isAccessibility && <TabHeader />}
    renderTabBar={props => {
        console.log(props); //return noting in console
        return <MaterialTabBar {...props}
            TabItemComponent={props => <MaterialTabItem {...props} pressColor="#000000" pressOpacity={1} />}
            style={theme.topTabBar}
            accessibilityRole="tablist"
        />
    }}
>

props return noting in renderTabBar when logged. if they would return the active state for example props.isFocused then I can do:

<MaterialTabItem {...props} pressColor="#000000" pressOpacity={1} accessibilityState={{selected: props.isFocused}} />

kashmiry avatar Jul 09 '24 07:07 kashmiry