Fix tab index of interactive base

This commit is contained in:
2023-11-30 17:31:38 +01:00
committed by Clément Le Bihan
parent e5acd56b0f
commit 9bce8d74c9
2 changed files with 33 additions and 0 deletions

View File

@@ -242,6 +242,7 @@ const InteractiveBase: React.FC<InteractiveBaseProps> = ({
<Animated.View style={[style, isDisabled ? disableStyle : animatedStyle]}>
<Pressable
focusable={focusable}
tabIndex={focusable ? 0 : -1}
disabled={isDisabled}
onHoverIn={handleMouseEnter}
onPressIn={handlePressIn}

32
front/rnw.d.ts vendored Normal file
View File

@@ -0,0 +1,32 @@
import React from "react";
import "react-native";
declare module "react-native" {
interface PressableStateCallbackType {
hovered?: boolean;
focused?: boolean;
}
interface AccessibilityProps {
tabIndex?: number;
}
interface ViewStyle {
transitionProperty?: string;
transitionDuration?: string;
}
interface TextProps {
href?: string;
hrefAttrs?: {
rel?: "noreferrer";
target?: string;
};
}
interface ViewProps {
dataSet?: Record<string, string>;
href?: string;
hrefAttrs?: {
rel: "noreferrer";
target?: "_blank";
};
onClick?: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
}
}