From b740cdb38ffc10017b4697267ba7e5636b0bf1ee Mon Sep 17 00:00:00 2001 From: "Mihail Ch." Date: Mon, 16 Sep 2024 17:15:16 +0200 Subject: [PATCH] Add attributes prop to DatePicker button (#7727) Co-authored-by: Mikhail Cherviakov --- src/date-picker/date-picker.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/date-picker/date-picker.tsx b/src/date-picker/date-picker.tsx index 015e67688f2..3f03fe402c5 100644 --- a/src/date-picker/date-picker.tsx +++ b/src/date-picker/date-picker.tsx @@ -1,4 +1,4 @@ -import {PureComponent, Ref} from 'react'; +import {PureComponent, Ref, ButtonHTMLAttributes} from 'react'; import * as React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; @@ -101,6 +101,7 @@ export type DatePickerProps = Omit Date | null size?: Size + buttonAttributes?: Pick, 'aria-label'> } /** @@ -134,7 +135,8 @@ export default class DatePicker extends PureComponent { maxDate: dateType, translations: PropTypes.object, locale: PropTypes.object, - size: PropTypes.oneOf(Object.values(Size)) + size: PropTypes.oneOf(Object.values(Size)), + buttonAttributes: PropTypes.object }; static defaultProps: DatePickerProps = { @@ -324,6 +326,7 @@ export default class DatePicker extends PureComponent { className={styles.anchor} text={false} disabled={this.props.disabled ?? false} + {...this.props.buttonAttributes} > {anchorContent}