From ac6b7d75f71c4de2b4c851d40e5066288b654f39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ska=C5=82ka?= Date: Tue, 6 Jun 2023 13:41:25 +0200 Subject: [PATCH 1/6] migrated Checkbox to PressableWithFeedback --- src/components/Checkbox.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/Checkbox.js b/src/components/Checkbox.js index 9e4f5da57dcf..f0464fbbad34 100644 --- a/src/components/Checkbox.js +++ b/src/components/Checkbox.js @@ -1,11 +1,12 @@ import React from 'react'; -import {View, Pressable} from 'react-native'; +import {View} from 'react-native'; import PropTypes from 'prop-types'; import styles from '../styles/styles'; import themeColors from '../styles/themes/default'; import stylePropTypes from '../styles/stylePropTypes'; import Icon from './Icon'; import * as Expensicons from './Icon/Expensicons'; +import PressableWithFeedback from './Pressable/PressableWithFeedback'; const propTypes = { /** Whether checkbox is checked */ @@ -34,6 +35,9 @@ const propTypes = { /** A ref to forward to the Pressable */ forwardedRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.instanceOf(React.Component)})]), + + /** A ref to forward to the Pressable */ + accessibilityLabel: PropTypes.string, }; const defaultProps = { @@ -45,6 +49,7 @@ const defaultProps = { forwardedRef: undefined, children: null, onMouseDown: undefined, + accessibilityLabel: 'checkbox', }; class Checkbox extends React.Component { @@ -95,7 +100,7 @@ class Checkbox extends React.Component { render() { return ( - {this.props.children ? ( this.props.children @@ -133,7 +141,7 @@ class Checkbox extends React.Component { )} )} - + ); } } From 06906824a9bb591de978691146f6ba94863953c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ska=C5=82ka?= Date: Mon, 12 Jun 2023 11:33:25 +0200 Subject: [PATCH 2/6] Review changes --- src/components/Checkbox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Checkbox.js b/src/components/Checkbox.js index 9c14aee58162..551c956a802c 100644 --- a/src/components/Checkbox.js +++ b/src/components/Checkbox.js @@ -49,7 +49,7 @@ const defaultProps = { forwardedRef: undefined, children: null, onMouseDown: undefined, - accessibilityLabel: 'checkbox', + accessibilityLabel: '', }; class Checkbox extends React.Component { @@ -86,7 +86,7 @@ class Checkbox extends React.Component { onMouseDown={this.props.onMouseDown} ref={this.props.forwardedRef} onPressOut={this.onBlur} - style={[this.props.style, styles.userSelectNone]} + style={this.props.style} onKeyDown={this.handleSpaceKey} accessibilityRole="checkbox" accessibilityState={{ From 46c4130a779895d763058377b59c43673bfdec93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ska=C5=82ka?= Date: Thu, 15 Jun 2023 12:10:55 +0200 Subject: [PATCH 3/6] removed hoverDimmingValue as it is set to 1 by default --- src/components/Checkbox.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/Checkbox.js b/src/components/Checkbox.js index 551c956a802c..ca906293fe49 100644 --- a/src/components/Checkbox.js +++ b/src/components/Checkbox.js @@ -93,7 +93,6 @@ class Checkbox extends React.Component { checked: this.props.isChecked, }} accessibilityLabel={this.props.accessibilityLabel} - hoverDimmingValue={1} pressDimmingValue={1} > {this.props.children ? ( From 4917bf7f333cd9e2c0728981192977273c1ef434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ska=C5=82ka?= Date: Wed, 21 Jun 2023 10:38:16 +0200 Subject: [PATCH 4/6] fixed bug with password text input eye icon --- src/components/TextInput/BaseTextInput.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TextInput/BaseTextInput.js b/src/components/TextInput/BaseTextInput.js index 91ab2162674f..d687e38d975d 100644 --- a/src/components/TextInput/BaseTextInput.js +++ b/src/components/TextInput/BaseTextInput.js @@ -343,7 +343,7 @@ class BaseTextInput extends Component { /> {Boolean(this.props.secureTextEntry) && ( e.preventDefault()} > From 56b01f4e4e576752a01108d55c395394d4fe1d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ska=C5=82ka?= Date: Fri, 23 Jun 2023 15:51:20 +0200 Subject: [PATCH 5/6] updated comment --- src/components/Checkbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Checkbox.js b/src/components/Checkbox.js index ee64ac90ecbf..7090abe319d6 100644 --- a/src/components/Checkbox.js +++ b/src/components/Checkbox.js @@ -36,7 +36,7 @@ const propTypes = { /** A ref to forward to the Pressable */ forwardedRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.instanceOf(React.Component)})]), - /** A ref to forward to the Pressable */ + /** An accessibility label for the checkbox */ accessibilityLabel: PropTypes.string, }; From a63eee4b177d4f57754baeab47fb58836592fb76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ska=C5=82ka?= Date: Tue, 27 Jun 2023 11:32:03 +0200 Subject: [PATCH 6/6] review changes + added accessibility labels --- ios/Podfile.lock | 6 +++--- src/components/Checkbox.js | 3 +-- src/components/CheckboxWithLabel.js | 5 +++++ .../CheckboxWithTooltipForMobileWebAndNative.js | 1 + .../CheckboxWithTooltip/checkboxWithTooltipPropTypes.js | 4 ++++ src/components/CheckboxWithTooltip/index.js | 2 ++ src/components/CheckboxWithTooltip/index.native.js | 1 + src/components/ReportActionItem/TaskPreview.js | 1 + src/components/TextInput/BaseTextInput.js | 4 +++- src/languages/en.js | 1 + src/languages/es.js | 1 + src/pages/EnablePayments/TermsStep.js | 2 ++ src/pages/ReimbursementAccount/ACHContractStep.js | 4 ++++ src/pages/ReimbursementAccount/BankAccountManualStep.js | 1 + src/pages/ReimbursementAccount/BankAccountPlaidStep.js | 1 + src/pages/ReimbursementAccount/CompanyStep.js | 1 + src/pages/ReimbursementAccount/RequestorStep.js | 1 + src/pages/settings/Payments/AddDebitCardPage.js | 1 + src/pages/workspace/WorkspaceMembersPage.js | 2 ++ 19 files changed, 36 insertions(+), 6 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 048eeca5f76f..41f6eadb9bd3 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1024,7 +1024,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Airship: c70eed50e429f97f5adb285423c7291fb7a032ae AirshipFrameworkProxy: 7bc4130c668c6c98e2d4c60fe4c9eb61a999be99 - boost: a7c83b31436843459a1961bfd74b96033dc77234 + boost: 57d2868c099736d80fcd648bf211b4431e51a558 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 FBLazyVector: ff54429f0110d3c722630a98096ba689c39f6d5f @@ -1067,7 +1067,7 @@ SPEC CHECKSUMS: Permission-LocationWhenInUse: 3ba99e45c852763f730eabecec2870c2382b7bd4 Plaid: 7d340abeadb46c7aa1a91f896c5b22395a31fcf2 PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef - RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda + RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 RCTRequired: e9e7b8b45aa9bedb2fdad71740adf07a7265b9be RCTTypeSafety: 9ae0e9206625e995f0df4d5b9ddc94411929fb30 React: a71c8e1380f07e01de721ccd52bcf9c03e81867d @@ -1141,4 +1141,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 4ed1c7b099741c82e2b0411b95f6468e72be6c76 -COCOAPODS: 1.12.0 +COCOAPODS: 1.12.1 diff --git a/src/components/Checkbox.js b/src/components/Checkbox.js index 7090abe319d6..d321b0abee77 100644 --- a/src/components/Checkbox.js +++ b/src/components/Checkbox.js @@ -37,7 +37,7 @@ const propTypes = { forwardedRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.instanceOf(React.Component)})]), /** An accessibility label for the checkbox */ - accessibilityLabel: PropTypes.string, + accessibilityLabel: PropTypes.string.isRequired, }; const defaultProps = { @@ -49,7 +49,6 @@ const defaultProps = { forwardedRef: undefined, children: null, onMouseDown: undefined, - accessibilityLabel: '', }; function Checkbox(props) { diff --git a/src/components/CheckboxWithLabel.js b/src/components/CheckboxWithLabel.js index 37cfcc895bff..18ad0880b92c 100644 --- a/src/components/CheckboxWithLabel.js +++ b/src/components/CheckboxWithLabel.js @@ -63,6 +63,9 @@ const propTypes = { /** Saves a draft of the input value when used in a form */ /* eslint-disable-next-line react/no-unused-prop-types */ shouldSaveDraft: PropTypes.bool, + + /** An accessibility label for the checkbox */ + accessibilityLabel: PropTypes.string, }; const defaultProps = { @@ -76,6 +79,7 @@ const defaultProps = { value: false, defaultValue: false, forwardedRef: () => {}, + accessibilityLabel: undefined, }; function CheckboxWithLabel(props) { @@ -100,6 +104,7 @@ function CheckboxWithLabel(props) { label={props.label} hasError={Boolean(props.errorText)} forwardedRef={props.forwardedRef} + accessibilityLabel={props.accessibilityLabel || props.label} /> ); diff --git a/src/components/CheckboxWithTooltip/checkboxWithTooltipPropTypes.js b/src/components/CheckboxWithTooltip/checkboxWithTooltipPropTypes.js index 2d438413a197..1656fa7a82cc 100644 --- a/src/components/CheckboxWithTooltip/checkboxWithTooltipPropTypes.js +++ b/src/components/CheckboxWithTooltip/checkboxWithTooltipPropTypes.js @@ -25,6 +25,9 @@ const propTypes = { /** Wheter the checkbox is disabled */ disabled: PropTypes.bool, + /** An accessibility label for the checkbox */ + accessibilityLabel: PropTypes.string, + /** Props inherited from withWindowDimensions */ ...windowDimensionsPropTypes, }; @@ -34,6 +37,7 @@ const defaultProps = { disabled: false, toggleTooltip: true, growlType: CONST.GROWL.WARNING, + accessibilityLabel: undefined, }; export {propTypes, defaultProps}; diff --git a/src/components/CheckboxWithTooltip/index.js b/src/components/CheckboxWithTooltip/index.js index 12f67fcd8c8a..70b1f345fb61 100644 --- a/src/components/CheckboxWithTooltip/index.js +++ b/src/components/CheckboxWithTooltip/index.js @@ -16,6 +16,7 @@ function CheckboxWithTooltip(props) { text={props.text} toggleTooltip={props.toggleTooltip} disabled={props.disabled} + accessibilityLabel={props.accessibilityLabel || props.text} /> ); } @@ -24,6 +25,7 @@ function CheckboxWithTooltip(props) { isChecked={props.isChecked} onPress={props.onPress} disabled={props.disabled} + accessibilityLabel={props.accessibilityLabel || props.text} /> ); return ( diff --git a/src/components/CheckboxWithTooltip/index.native.js b/src/components/CheckboxWithTooltip/index.native.js index 56605f95ac2e..61d171d1717a 100644 --- a/src/components/CheckboxWithTooltip/index.native.js +++ b/src/components/CheckboxWithTooltip/index.native.js @@ -11,6 +11,7 @@ function CheckboxWithTooltip(props) { onPress={props.onPress} text={props.text} toggleTooltip={props.toggleTooltip} + accessibilityLabel={props.accessibilityLabel || props.text} /> ); } diff --git a/src/components/ReportActionItem/TaskPreview.js b/src/components/ReportActionItem/TaskPreview.js index 2e47d7ae471e..30f0864bd35a 100644 --- a/src/components/ReportActionItem/TaskPreview.js +++ b/src/components/ReportActionItem/TaskPreview.js @@ -81,6 +81,7 @@ function TaskPreview(props) { TaskUtils.completeTask(props.taskReportID, taskTitle); } }} + accessibilityLabel={props.translate('newTaskPage.task')} /> diff --git a/src/components/TextInput/BaseTextInput.js b/src/components/TextInput/BaseTextInput.js index d687e38d975d..d307b6eff902 100644 --- a/src/components/TextInput/BaseTextInput.js +++ b/src/components/TextInput/BaseTextInput.js @@ -19,6 +19,7 @@ import CONST from '../../CONST'; import FormHelpMessage from '../FormHelpMessage'; import isInputAutoFilled from '../../libs/isInputAutoFilled'; import * as Pressables from '../Pressable'; +import withLocalize from '../withLocalize'; const PressableWithoutFeedback = Pressables.PressableWithoutFeedback; class BaseTextInput extends Component { @@ -346,6 +347,7 @@ class BaseTextInput extends Component { style={[styles.flex1, styles.textInputIconContainer]} onPress={this.togglePasswordVisibility} onMouseDown={(e) => e.preventDefault()} + accessibilityLabel={this.props.translate('common.visible')} > ( @@ -72,6 +73,7 @@ function TermsStep(props) { )} /> ( diff --git a/src/pages/ReimbursementAccount/ACHContractStep.js b/src/pages/ReimbursementAccount/ACHContractStep.js index 2e0979b00253..6083661b0d0d 100644 --- a/src/pages/ReimbursementAccount/ACHContractStep.js +++ b/src/pages/ReimbursementAccount/ACHContractStep.js @@ -166,6 +166,7 @@ function ACHContractStep(props) { {props.translate('beneficialOwnersStep.checkAllThatApply')} ( @@ -186,6 +187,7 @@ function ACHContractStep(props) { shouldSaveDraft /> ( @@ -251,6 +253,7 @@ function ACHContractStep(props) { )} {props.translate('beneficialOwnersStep.agreement')} ( @@ -263,6 +266,7 @@ function ACHContractStep(props) { shouldSaveDraft /> {props.translate('beneficialOwnersStep.certifyTrueAndAccurate')}} diff --git a/src/pages/ReimbursementAccount/BankAccountManualStep.js b/src/pages/ReimbursementAccount/BankAccountManualStep.js index 5e495f70b27e..94e136dc0dee 100644 --- a/src/pages/ReimbursementAccount/BankAccountManualStep.js +++ b/src/pages/ReimbursementAccount/BankAccountManualStep.js @@ -112,6 +112,7 @@ class BankAccountManualStep extends React.Component { shouldUseDefaultValue={shouldDisableInputs} /> ( diff --git a/src/pages/ReimbursementAccount/BankAccountPlaidStep.js b/src/pages/ReimbursementAccount/BankAccountPlaidStep.js index 8e46b1757e1c..9f0325128efa 100644 --- a/src/pages/ReimbursementAccount/BankAccountPlaidStep.js +++ b/src/pages/ReimbursementAccount/BankAccountPlaidStep.js @@ -116,6 +116,7 @@ class BankAccountPlaidStep extends React.Component { /> {Boolean(selectedPlaidAccountID) && !_.isEmpty(lodashGet(this.props.plaidData, 'bankAccounts')) && ( ( diff --git a/src/pages/ReimbursementAccount/CompanyStep.js b/src/pages/ReimbursementAccount/CompanyStep.js index e44d0562b58e..21648144579c 100644 --- a/src/pages/ReimbursementAccount/CompanyStep.js +++ b/src/pages/ReimbursementAccount/CompanyStep.js @@ -257,6 +257,7 @@ class CompanyStep extends React.Component { /> ( diff --git a/src/pages/ReimbursementAccount/RequestorStep.js b/src/pages/ReimbursementAccount/RequestorStep.js index c6496db73adc..0fa71833b34c 100644 --- a/src/pages/ReimbursementAccount/RequestorStep.js +++ b/src/pages/ReimbursementAccount/RequestorStep.js @@ -172,6 +172,7 @@ class RequestorStep extends React.Component { shouldSaveDraft /> ( diff --git a/src/pages/settings/Payments/AddDebitCardPage.js b/src/pages/settings/Payments/AddDebitCardPage.js index 77b7089fd2ef..65be895baee3 100644 --- a/src/pages/settings/Payments/AddDebitCardPage.js +++ b/src/pages/settings/Payments/AddDebitCardPage.js @@ -187,6 +187,7 @@ class DebitCardPage extends Component { )} ( diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 4c170deb9ec5..53809fcbfd50 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -315,6 +315,7 @@ function WorkspaceMembersPage(props) { toggleUser(item.accountID, item.pendingAction)} + accessibilityLabel={item.displayName} /> _.contains(selectedEmployees, Number(accountID)))} onPress={() => toggleAllUsers(removableMembers)} + accessibilityLabel={props.translate('workspace.people.selectAll')} /> {props.translate('workspace.people.selectAll')}