Skip to content
Merged
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
3 changes: 3 additions & 0 deletions src/components/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import type ChildrenProps from '@src/types/utils/ChildrenProps';
import type WithSentryLabel from '@src/types/utils/SentryLabel';
import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';

Check warning on line 12 in src/components/Checkbox.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'./Icon/Expensicons' import is restricted from being used by a pattern. Direct imports from Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details
import type {PressableRef} from './Pressable/GenericPressable/types';
import PressableWithFeedback from './Pressable/PressableWithFeedback';

Expand Down Expand Up @@ -131,6 +131,9 @@
style={[StyleUtils.getCheckboxPressableStyle(containerBorderRadius + 2), style]} // to align outline on focus, border-radius of pressable should be 2px more than Checkbox
onKeyDown={handleSpaceOrEnterKey}
role={CONST.ROLE.CHECKBOX}
accessibilityState={{
checked: isIndeterminate ? 'mixed' : isChecked,
}}
/* true → checked
false → unchecked
mixed → indeterminate */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ function GenericPressable({
...accessibilityState,
}}
aria-disabled={isDisabled}
aria-checked={accessibilityState?.checked}
aria-selected={accessibilityState?.selected}
aria-keyshortcuts={keyboardShortcut && `${keyboardShortcut.modifiers.join('')}+${keyboardShortcut.shortcutKey}`}
// ios-only form of inputs
Expand Down
Loading