diff --git a/docs/accessibilityinfo.md b/docs/accessibilityinfo.md index 81e2c119ade..bc93e4ae870 100644 --- a/docs/accessibilityinfo.md +++ b/docs/accessibilityinfo.md @@ -236,6 +236,10 @@ Query whether reduce motion and prefer cross-fade transitions settings are curre ### `setAccessibilityFocus()` +:::warning Deprecated +Prefer using `sendAccessibilityEvent` with eventType `focus` instead. +::: + ```tsx static setAccessibilityFocus(reactTag: number); ``` @@ -247,3 +251,22 @@ On Android, this calls `UIManager.sendAccessibilityEvent` method with passed `re :::note Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. ::: + +--- + +### `sendAccessibilityEvent()` + +```tsx +static sendAccessibilityEvent(host: HostInstance, eventType: AccessibilityEventTypes); +``` + +Imperatively trigger an accessibility event on a React component, like changing the focused element for a screen reader. + +:::note +Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +::: + +| Name | Type | Description | +| -------------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| host
Required
| HostInstance | The component ref to send the event to. | +| eventType
Required
| AccessibilityEventTypes | One of `'click'` (Android only), `'focus'`, `'viewHoverEnter'` (Android only), or `'windowStateChange'` (Android only) | diff --git a/website/versioned_docs/version-0.77/accessibilityinfo.md b/website/versioned_docs/version-0.77/accessibilityinfo.md index 3d77f80884f..93902f6fb5a 100644 --- a/website/versioned_docs/version-0.77/accessibilityinfo.md +++ b/website/versioned_docs/version-0.77/accessibilityinfo.md @@ -234,6 +234,10 @@ Query whether reduce motion and prefer cross-fade transitions settings are curre ### `setAccessibilityFocus()` +:::warning Deprecated +Prefer using `sendAccessibilityEvent` with eventType `focus` instead. +::: + ```tsx static setAccessibilityFocus(reactTag: number); ``` @@ -242,4 +246,25 @@ Set accessibility focus to a React component. On Android, this calls `UIManager.sendAccessibilityEvent` method with passed `reactTag` and `UIManager.AccessibilityEventTypes.typeViewFocused` arguments. -> **Note**: Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +:::note +Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +::: + +--- + +### `sendAccessibilityEvent()` + +```tsx +static sendAccessibilityEvent(host: HostInstance, eventType: AccessibilityEventTypes); +``` + +Imperatively trigger an accessibility event on a React component, like changing the focused element for a screen reader. + +:::note +Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +::: + +| Name | Type | Description | +| -------------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| host
Required
| HostInstance | The component ref to send the event to. | +| eventType
Required
| AccessibilityEventTypes | One of `'click'` (Android only), `'focus'`, `'viewHoverEnter'` (Android only), or `'windowStateChange'` (Android only) | diff --git a/website/versioned_docs/version-0.78/accessibilityinfo.md b/website/versioned_docs/version-0.78/accessibilityinfo.md index 3d77f80884f..93902f6fb5a 100644 --- a/website/versioned_docs/version-0.78/accessibilityinfo.md +++ b/website/versioned_docs/version-0.78/accessibilityinfo.md @@ -234,6 +234,10 @@ Query whether reduce motion and prefer cross-fade transitions settings are curre ### `setAccessibilityFocus()` +:::warning Deprecated +Prefer using `sendAccessibilityEvent` with eventType `focus` instead. +::: + ```tsx static setAccessibilityFocus(reactTag: number); ``` @@ -242,4 +246,25 @@ Set accessibility focus to a React component. On Android, this calls `UIManager.sendAccessibilityEvent` method with passed `reactTag` and `UIManager.AccessibilityEventTypes.typeViewFocused` arguments. -> **Note**: Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +:::note +Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +::: + +--- + +### `sendAccessibilityEvent()` + +```tsx +static sendAccessibilityEvent(host: HostInstance, eventType: AccessibilityEventTypes); +``` + +Imperatively trigger an accessibility event on a React component, like changing the focused element for a screen reader. + +:::note +Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +::: + +| Name | Type | Description | +| -------------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| host
Required
| HostInstance | The component ref to send the event to. | +| eventType
Required
| AccessibilityEventTypes | One of `'click'` (Android only), `'focus'`, `'viewHoverEnter'` (Android only), or `'windowStateChange'` (Android only) | diff --git a/website/versioned_docs/version-0.79/accessibilityinfo.md b/website/versioned_docs/version-0.79/accessibilityinfo.md index 3d77f80884f..93902f6fb5a 100644 --- a/website/versioned_docs/version-0.79/accessibilityinfo.md +++ b/website/versioned_docs/version-0.79/accessibilityinfo.md @@ -234,6 +234,10 @@ Query whether reduce motion and prefer cross-fade transitions settings are curre ### `setAccessibilityFocus()` +:::warning Deprecated +Prefer using `sendAccessibilityEvent` with eventType `focus` instead. +::: + ```tsx static setAccessibilityFocus(reactTag: number); ``` @@ -242,4 +246,25 @@ Set accessibility focus to a React component. On Android, this calls `UIManager.sendAccessibilityEvent` method with passed `reactTag` and `UIManager.AccessibilityEventTypes.typeViewFocused` arguments. -> **Note**: Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +:::note +Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +::: + +--- + +### `sendAccessibilityEvent()` + +```tsx +static sendAccessibilityEvent(host: HostInstance, eventType: AccessibilityEventTypes); +``` + +Imperatively trigger an accessibility event on a React component, like changing the focused element for a screen reader. + +:::note +Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +::: + +| Name | Type | Description | +| -------------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| host
Required
| HostInstance | The component ref to send the event to. | +| eventType
Required
| AccessibilityEventTypes | One of `'click'` (Android only), `'focus'`, `'viewHoverEnter'` (Android only), or `'windowStateChange'` (Android only) | diff --git a/website/versioned_docs/version-0.80/accessibilityinfo.md b/website/versioned_docs/version-0.80/accessibilityinfo.md index 3d77f80884f..93902f6fb5a 100644 --- a/website/versioned_docs/version-0.80/accessibilityinfo.md +++ b/website/versioned_docs/version-0.80/accessibilityinfo.md @@ -234,6 +234,10 @@ Query whether reduce motion and prefer cross-fade transitions settings are curre ### `setAccessibilityFocus()` +:::warning Deprecated +Prefer using `sendAccessibilityEvent` with eventType `focus` instead. +::: + ```tsx static setAccessibilityFocus(reactTag: number); ``` @@ -242,4 +246,25 @@ Set accessibility focus to a React component. On Android, this calls `UIManager.sendAccessibilityEvent` method with passed `reactTag` and `UIManager.AccessibilityEventTypes.typeViewFocused` arguments. -> **Note**: Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +:::note +Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +::: + +--- + +### `sendAccessibilityEvent()` + +```tsx +static sendAccessibilityEvent(host: HostInstance, eventType: AccessibilityEventTypes); +``` + +Imperatively trigger an accessibility event on a React component, like changing the focused element for a screen reader. + +:::note +Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +::: + +| Name | Type | Description | +| -------------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| host
Required
| HostInstance | The component ref to send the event to. | +| eventType
Required
| AccessibilityEventTypes | One of `'click'` (Android only), `'focus'`, `'viewHoverEnter'` (Android only), or `'windowStateChange'` (Android only) | diff --git a/website/versioned_docs/version-0.81/accessibilityinfo.md b/website/versioned_docs/version-0.81/accessibilityinfo.md index 3d77f80884f..93902f6fb5a 100644 --- a/website/versioned_docs/version-0.81/accessibilityinfo.md +++ b/website/versioned_docs/version-0.81/accessibilityinfo.md @@ -234,6 +234,10 @@ Query whether reduce motion and prefer cross-fade transitions settings are curre ### `setAccessibilityFocus()` +:::warning Deprecated +Prefer using `sendAccessibilityEvent` with eventType `focus` instead. +::: + ```tsx static setAccessibilityFocus(reactTag: number); ``` @@ -242,4 +246,25 @@ Set accessibility focus to a React component. On Android, this calls `UIManager.sendAccessibilityEvent` method with passed `reactTag` and `UIManager.AccessibilityEventTypes.typeViewFocused` arguments. -> **Note**: Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +:::note +Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +::: + +--- + +### `sendAccessibilityEvent()` + +```tsx +static sendAccessibilityEvent(host: HostInstance, eventType: AccessibilityEventTypes); +``` + +Imperatively trigger an accessibility event on a React component, like changing the focused element for a screen reader. + +:::note +Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +::: + +| Name | Type | Description | +| -------------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| host
Required
| HostInstance | The component ref to send the event to. | +| eventType
Required
| AccessibilityEventTypes | One of `'click'` (Android only), `'focus'`, `'viewHoverEnter'` (Android only), or `'windowStateChange'` (Android only) | diff --git a/website/versioned_docs/version-0.82/accessibilityinfo.md b/website/versioned_docs/version-0.82/accessibilityinfo.md index 81e2c119ade..bc93e4ae870 100644 --- a/website/versioned_docs/version-0.82/accessibilityinfo.md +++ b/website/versioned_docs/version-0.82/accessibilityinfo.md @@ -236,6 +236,10 @@ Query whether reduce motion and prefer cross-fade transitions settings are curre ### `setAccessibilityFocus()` +:::warning Deprecated +Prefer using `sendAccessibilityEvent` with eventType `focus` instead. +::: + ```tsx static setAccessibilityFocus(reactTag: number); ``` @@ -247,3 +251,22 @@ On Android, this calls `UIManager.sendAccessibilityEvent` method with passed `re :::note Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. ::: + +--- + +### `sendAccessibilityEvent()` + +```tsx +static sendAccessibilityEvent(host: HostInstance, eventType: AccessibilityEventTypes); +``` + +Imperatively trigger an accessibility event on a React component, like changing the focused element for a screen reader. + +:::note +Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +::: + +| Name | Type | Description | +| -------------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| host
Required
| HostInstance | The component ref to send the event to. | +| eventType
Required
| AccessibilityEventTypes | One of `'click'` (Android only), `'focus'`, `'viewHoverEnter'` (Android only), or `'windowStateChange'` (Android only) | diff --git a/website/versioned_docs/version-0.83/accessibilityinfo.md b/website/versioned_docs/version-0.83/accessibilityinfo.md index 81e2c119ade..bc93e4ae870 100644 --- a/website/versioned_docs/version-0.83/accessibilityinfo.md +++ b/website/versioned_docs/version-0.83/accessibilityinfo.md @@ -236,6 +236,10 @@ Query whether reduce motion and prefer cross-fade transitions settings are curre ### `setAccessibilityFocus()` +:::warning Deprecated +Prefer using `sendAccessibilityEvent` with eventType `focus` instead. +::: + ```tsx static setAccessibilityFocus(reactTag: number); ``` @@ -247,3 +251,22 @@ On Android, this calls `UIManager.sendAccessibilityEvent` method with passed `re :::note Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. ::: + +--- + +### `sendAccessibilityEvent()` + +```tsx +static sendAccessibilityEvent(host: HostInstance, eventType: AccessibilityEventTypes); +``` + +Imperatively trigger an accessibility event on a React component, like changing the focused element for a screen reader. + +:::note +Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`. +::: + +| Name | Type | Description | +| -------------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| host
Required
| HostInstance | The component ref to send the event to. | +| eventType
Required
| AccessibilityEventTypes | One of `'click'` (Android only), `'focus'`, `'viewHoverEnter'` (Android only), or `'windowStateChange'` (Android only) |