Repository navigation
Accessibility: Fix - contrast, screen reader labels and tap areas #2530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
98949ec
e2ef53d
7d9af6d
9201575
2dd553a
279b378
e09adfb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ import { | |
| SlateDark, | ||
| Success, | ||
| White, | ||
| Caution70, | ||
| } from '../../styles/colors'; | ||
| import Haptic from '../haptic-feedback/haptic'; | ||
| import {ActiveOpacity} from '../styled/Containers'; | ||
|
|
@@ -273,7 +274,7 @@ const getButtonTextColor = ({ | |
| ? Caution50 | ||
| : Caution60 | ||
| : theme.dark | ||
| ? Caution60 | ||
| ? Caution70 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same change is needed in
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in e09adfb: the danger pill text now uses |
||
| : White; | ||
| } | ||
| return White; | ||
|
|
@@ -460,7 +461,7 @@ const getPillTextColor = ({ | |
| ? Caution50 | ||
| : Caution60 | ||
| : theme.dark | ||
| ? Caution60 | ||
| ? Caution70 | ||
| : White; | ||
| } | ||
| return theme?.dark ? White : Action; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ import {useTranslation} from 'react-i18next'; | |
| import {View} from 'react-native'; | ||
| import {RoundedCheckbox} from 'react-native-rounded-checkbox'; | ||
| import Check from '../../../assets/img/check.svg'; | ||
| import {Action, SlateDark} from '../../styles/colors'; | ||
| import {Action, SlateDark, Slate} from '../../styles/colors'; | ||
| import {useTheme} from '../../contexts'; | ||
|
|
||
| interface Props { | ||
|
|
@@ -36,8 +36,8 @@ const Border: React.FC<BorderProps & React.ComponentProps<typeof View>> = ({ | |
| : checked | ||
| ? Action | ||
| : theme?.dark | ||
| ? SlateDark | ||
| : '#E5E5F2'; | ||
| ? Slate | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only the border changed; the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. The fill moves to the theme roles in that same follow-up, with a visual check in both themes. |
||
| : SlateDark; | ||
| return ( | ||
| <View | ||
| style={[ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ import { | |
| ProgressBlue, | ||
| Slate, | ||
| White, | ||
| Placeholder, | ||
| } from '../../styles/colors'; | ||
| import {ActiveOpacity} from '../styled/Containers'; | ||
| import {BaseText} from '../styled/Text'; | ||
|
|
@@ -102,12 +103,12 @@ const InputContainer: React.FC< | |
| <View | ||
| style={[ | ||
| styles.inputContainer, | ||
| {borderColor: theme.dark ? LuckySevens : Slate}, | ||
| {borderColor: LuckySevens}, | ||
| paddingRight ? {paddingRight} : null, | ||
| isFocused | ||
| ? { | ||
| backgroundColor: theme.dark ? 'transparent' : '#fafbff', | ||
| borderColor: theme.dark ? LuckySevens : Slate, | ||
| borderColor: LuckySevens, | ||
| borderBottomColor: ProgressBlue, | ||
| } | ||
| : null, | ||
|
|
@@ -256,6 +257,7 @@ const BoxInput = React.forwardRef< | |
| }, | ||
| ref, | ||
| ) => { | ||
| const theme = useTheme(); | ||
| const isPassword = type === 'password'; | ||
| const isSearch = type === 'search'; | ||
| const [isFocused, setIsFocused] = useState(false); | ||
|
|
@@ -315,7 +317,7 @@ const BoxInput = React.forwardRef< | |
|
|
||
| <Input | ||
| keyboardType={_keyboardType} | ||
| placeholderTextColor={Slate} | ||
| placeholderTextColor={theme.dark ? Slate : Placeholder} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The placeholder colour is now a per-call-site ternary in 9 places, with two different dark values:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. A follow-up PR adds color roles to the theme, including a placeholder role, so the per-screen values can go. |
||
| {...props} | ||
| editable={!disabled} | ||
| ref={ref} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
importantForAccessibilityis Android-only. AddaccessibilityElementsHiddenso VoiceOver skips it too. Low impact today since the subtree has no text, but it makes the "hidden from screen readers" claim true on both platforms.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
accessibilityElementsHiddenin e09adfb so VoiceOver skips it too.