From d2957c12a5066ceffe1980ece4e6188b154f6443 Mon Sep 17 00:00:00 2001 From: spiros dimopulos Date: Thu, 7 May 2026 12:13:55 +0300 Subject: [PATCH 1/9] DRYD-1923: added htmlFor and id props to Label; extended normalizeLabel to clone pre-built Labels including the new props; extended labelable to pass htmlFor and id to normalizeLabel; --- src/components/Label.jsx | 10 +++++++--- src/enhancers/labelable.jsx | 10 +++++++++- src/helpers/normalizeLabel.jsx | 25 +++++++++++++++++++++++-- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/components/Label.jsx b/src/components/Label.jsx index 9e47cbf..46c5733 100644 --- a/src/components/Label.jsx +++ b/src/components/Label.jsx @@ -6,12 +6,16 @@ const propTypes = { children: PropTypes.node, readOnly: PropTypes.bool, required: PropTypes.bool, + htmlFor: PropTypes.string, + id: PropTypes.string, }; const defaultProps = { children: undefined, readOnly: undefined, required: undefined, + htmlFor: undefined, + id: undefined, }; /** @@ -22,14 +26,14 @@ export default function Label(props) { children, readOnly, required, + htmlFor, + id, } = props; const className = (required && !readOnly) ? styles.required : styles.common; return ( - // FIXME: Set the htmlFor prop to associate the labeled control. - // eslint-disable-next-line jsx-a11y/label-has-associated-control -