xgfe / react-native-datepicker

react native datePicker component for both Android and IOS, useing DatePikcerAndroid, TimePickerAndroid and DatePickerIOS
MIT License
2.12k stars 727 forks source link

Accessibility: Not able to focus on cancel & confirm button [iOS Specific] #430

Open naresh-kumar-ios opened 3 years ago

naresh-kumar-ios commented 3 years ago

Issue

I am implementing the accessibility in my application. The issue is, when I open the date Picker then it's not able to set focus on the "Cancel or Confirm" button.

Expected Behavior

On tap of cancel or confirm button the button should get selected / focused then user can tap on it to select or cancel the popup.

Code


<DatePicker
          style={{ width: 0, height: 0 }}
          date={this.state.fieldData['dateOfBirth'] || TIME.selectorDefaultDate}
          mode="date"
          placeholder="select date"
          format={TIME.dateFormat}
          androidMode="spinner"
          confirmBtnText="Confirm"
          cancelBtnText="Cancel"
          maxDate={moment().format(TIME.dateFormat)}
          hideText
          showIcon={false}
          ref={(picker) => {
            this.storeRefs('dateOfBirth', picker)
          }}
          customStyles={{
            dateIcon: styles.dateIcon,
            dateInput: {
              marginLeft: 36,
            },
            btnTextConfirm: {
              color: THEME.$blue,
            },
          }}
          onDateChange={(date) => {
            if (!this.validateDate(date)) {
              setTimeout(() => {
                showAlert(MESSAGE.CHECK_DOB)
              }, 300);
            }
            else {
              this.changeHandler('dateOfBirth', date);
            }
          }}
        />

Environment

  1. react-native -v: 0.59.5, react-native-cli: 2.0.1
  2. node -v: v8.13.0
  3. npm -v: 6.4.1
  4. yarn --version: 1.12.3
  5. target platform: iOS
  6. operating system: MacOS: 10.15.3
shehryar-zs commented 2 years ago

you found any solution?