Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5971,7 +5971,9 @@ const CONST = {

ACCESSIBILITY_LABELS: {
COLLAPSE: 'Collapse',
COLLAPSED: 'Collapsed',
EXPAND: 'Expand',
EXPANDED: 'Expanded',
ERROR: 'Error',
},

Expand Down
5 changes: 5 additions & 0 deletions src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ type ButtonProps = Partial<ChildrenProps> &
/** Accessibility label for the component */
accessibilityLabel?: string;

/** Accessibility hint for the component */
accessibilityHint?: string;

/** The text for the button label */
text?: string;

Expand Down Expand Up @@ -284,6 +287,7 @@ function Button({
id = '',
testID = undefined,
accessibilityLabel = '',
accessibilityHint = undefined,
link = false,
isContentCentered = false,
isPressOnEnterActive,
Expand Down Expand Up @@ -532,6 +536,7 @@ function Button({
onHoverIn={!isDisabled || !shouldStayNormalOnDisable ? () => setIsHovered(true) : undefined}
onHoverOut={!isDisabled || !shouldStayNormalOnDisable ? () => setIsHovered(false) : undefined}
sentryLabel={sentryLabel}
accessibilityHint={accessibilityHint}
>
{shouldBlendOpacity && <View style={[StyleSheet.absoluteFill, buttonBlendForegroundStyle]} />}
{renderContent()}
Expand Down
7 changes: 7 additions & 0 deletions src/components/ButtonWithDropdownMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ function ButtonWithDropdownMenu<IValueType>({ref, ...props}: ButtonWithDropdownM
);
const splitButtonWrapperStyle = isSplitButton ? [styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter] : {};
const isTextTooLong = customText && customText?.length > 6;
const accessibilityExpandState = isMenuVisible ? CONST.ACCESSIBILITY_LABELS.EXPANDED : CONST.ACCESSIBILITY_LABELS.COLLAPSED;
const buttonText = customText ?? selectedItem?.text ?? '';
const accessibilityLabel = `${accessibilityExpandState}, ${buttonText}`;

const handlePress = useCallback(
(event?: GestureResponderEvent | KeyboardEvent) => {
Expand Down Expand Up @@ -195,6 +198,8 @@ function ButtonWithDropdownMenu<IValueType>({ref, ...props}: ButtonWithDropdownM
iconRightFill={hasError ? theme.buttonIcon : undefined}
iconRightHoverFill={hasError ? theme.buttonIcon : undefined}
sentryLabel={sentryLabel}
accessibilityLabel={!isSplitButton ? accessibilityLabel : undefined}
accessibilityHint=""
/>

{isSplitButton && (
Expand All @@ -213,6 +218,8 @@ function ButtonWithDropdownMenu<IValueType>({ref, ...props}: ButtonWithDropdownM
innerStyles={[styles.dropDownButtonCartIconContainerPadding, innerStyleDropButton, isButtonSizeSmall && styles.dropDownButtonCartIcon]}
enterKeyEventListenerPriority={enterKeyEventListenerPriority}
sentryLabel={sentryLabel}
accessibilityLabel={accessibilityLabel}
accessibilityHint=""
>
<View style={[styles.dropDownButtonCartIconView, innerStyleDropButton]}>
<View style={[success ? styles.buttonSuccessDivider : styles.buttonDivider]} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
accessible
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
accessibilityHint={props.accessibilityHint ?? props.accessibilityLabel}
ref={ref}
accessibilityHint={props.accessibilityHint ?? props.accessibilityLabel}

Check failure on line 14 in src/components/Pressable/GenericPressable/implementation/index.native.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

No duplicate props allowed

Check failure on line 14 in src/components/Pressable/GenericPressable/implementation/index.native.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

No duplicate props allowed

Check failure on line 14 in src/components/Pressable/GenericPressable/implementation/index.native.tsx

View workflow job for this annotation

GitHub Actions / typecheck

JSX elements cannot have multiple attributes with the same name.

Check failure on line 14 in src/components/Pressable/GenericPressable/implementation/index.native.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

No duplicate props allowed

Check failure on line 14 in src/components/Pressable/GenericPressable/implementation/index.native.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

No duplicate props allowed
/>
);
}
Expand Down
Loading