UNPKG

react-native-a11y

Version:

Improvements of a11y for ReactNative, this library improve work with reader and keyboard focus and reader in general.

29 lines 1.15 kB
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } import React from 'react'; import { useCanBeFocused } from '../../providers'; import NativeFocusWrapper from '../../nativeSpecs/A11yFocusWrapperNativeComponent'; import { useFocusStyle } from '../../hooks'; export const KeyboardFocusView = /*#__PURE__*/React.forwardRef(({ onFocusChange, style, focusStyle, canBeFocused = true, onKeyUpPress, onKeyDownPress, ...props }, ref) => { const canBecomeFocused = useCanBeFocused(); const { fStyle, onFocusChangeHandler } = useFocusStyle(focusStyle, onFocusChange); return /*#__PURE__*/React.createElement(NativeFocusWrapper, _extends({ ref: ref, style: [style, fStyle], canBeFocused: canBecomeFocused && canBeFocused, onKeyUpPress: onKeyUpPress, onKeyDownPress: onKeyDownPress, onFocusChange: onFocusChangeHandler }, props)); }); //# sourceMappingURL=KeyboardFocusView.ios.js.map