Fix keyboard support on the dropdown (#1073)

* Fix: dropdown now supports accessibility labels and keyboard controls

* Fix event propagation around the post dropdown
This commit is contained in:
Paul Frazee 2023-07-28 18:12:21 -05:00 committed by GitHub
parent 45da8a86c9
commit 1195f28992
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 109 additions and 39 deletions

View file

@ -6,7 +6,7 @@ import {
NativeDropdown,
DropdownItem as NativeDropdownItem,
} from './NativeDropdown'
import {Pressable} from 'react-native'
import {EventStopper} from '../EventStopper'
export function PostDropdownBtn({
testID,
@ -141,8 +141,13 @@ export function PostDropdownBtn({
].filter(Boolean) as NativeDropdownItem[]
return (
<Pressable testID={testID} accessibilityRole="button">
<NativeDropdown items={dropdownItems} />
</Pressable>
<EventStopper>
<NativeDropdown
testID={testID}
items={dropdownItems}
accessibilityLabel="More post options"
accessibilityHint=""
/>
</EventStopper>
)
}