Some a11y

This commit is contained in:
Eric Bailey
2025-06-23 09:29:54 -05:00
parent ca4e7f9cc0
commit 2a69ee8fac
+18 -1
View File
@@ -131,7 +131,13 @@ export function Target({
}) })
} }
export function Content({children}: {children: React.ReactNode}) { export function Content({
children,
label,
}: {
children: React.ReactNode
label: string
}) {
const {position, ready, onVisibleChange} = useContext(TooltipContext) const {position, ready, onVisibleChange} = useContext(TooltipContext)
const {targetMeasurements} = useContext(TargetContext) const {targetMeasurements} = useContext(TargetContext)
const requestClose = useCallback(() => { const requestClose = useCallback(() => {
@@ -143,6 +149,7 @@ export function Content({children}: {children: React.ReactNode}) {
return ( return (
<Portal> <Portal>
<Bubble <Bubble
label={label}
position={position} position={position}
/* /*
* Gotta pass these in here. Inside the Bubble, we're Potal-ed outside * Gotta pass these in here. Inside the Bubble, we're Potal-ed outside
@@ -158,11 +165,13 @@ export function Content({children}: {children: React.ReactNode}) {
function Bubble({ function Bubble({
children, children,
label,
position, position,
requestClose, requestClose,
targetMeasurements, targetMeasurements,
}: { }: {
children: React.ReactNode children: React.ReactNode
label: string
position: TooltipContextType['position'] position: TooltipContextType['position']
requestClose: () => void requestClose: () => void
targetMeasurements: Exclude< targetMeasurements: Exclude<
@@ -284,6 +293,14 @@ function Bubble({
return ( return (
<View <View
accessible
role="alert"
accessibilityHint=""
accessibilityLabel={label}
// android
importantForAccessibility="yes"
// ios
accessibilityViewIsModal
style={[ style={[
a.absolute, a.absolute,
a.align_start, a.align_start,