/* * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * * Modifications Copyright OpenSearch Contributors. See * GitHub history for details. */ import React from "react"; import PropTypes from "prop-types"; import FocusTrap from "focus-trap-react"; import classnames from "classnames"; import { ScreenReaderOnly } from "./screen_reader_only"; export default class MonthDropdownOptions extends React.Component { static propTypes = { onCancel: PropTypes.func.isRequired, onChange: PropTypes.func.isRequired, month: PropTypes.number.isRequired, monthNames: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired, accessibleMode: PropTypes.bool }; constructor(...args) { super(...args); this.state = { preSelection: this.props.month, readInstructions: false }; } renderOptions = () => { return this.props.monthNames.map((month, i) => (
You are focused on a month selector menu. Use the up and down arrows to select a year, then hit enter to confirm your selection. {this.props.monthNames[this.state.preSelection]} is the currently focused month.
); } return this.props.accessibleMode ? (