diff --git a/packages/core/src/components/MonthPicker/MonthPicker.jsx b/packages/core/src/components/MonthPicker/MonthPicker.jsx index ab1ad87b52..34c057e5b3 100644 --- a/packages/core/src/components/MonthPicker/MonthPicker.jsx +++ b/packages/core/src/components/MonthPicker/MonthPicker.jsx @@ -1,9 +1,11 @@ +import 'core-js/fn/array/includes'; import Button from '../Button/Button'; import Choice from '../ChoiceList/Choice'; import FormLabel from '../FormLabel/FormLabel'; import PropTypes from 'prop-types'; import React from 'react'; import classNames from 'classnames'; +import uniqueId from 'lodash.uniqueid'; /* `` @@ -32,6 +34,8 @@ const monthNumbers = (() => { export class MonthPicker extends React.PureComponent { constructor(props) { super(props); + this.hintId = uniqueId('monthpicker_hint_'); + this.labelId = uniqueId('monthpicker_label_'); this.months = getMonthNames(props.locale); this.monthsLong = getMonthNames(props.locale, false); @@ -109,14 +113,15 @@ export class MonthPicker extends React.PureComponent { {this.months.map((month, i) => (
  • this.handleChange(e)} className="ds-c-month-picker__month" disabled={disabledMonths.includes(i + 1)} inversed={inversed} - aria-label={this.monthsLong[i]} + onChange={e => this.handleChange(e)} + name={name} + value={i + 1} > {month} @@ -129,6 +134,7 @@ export class MonthPicker extends React.PureComponent { renderButton(text, onClick) { return (