-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(#6109): SpectrumFieldProps should return labelProps that can be spread on a label or React-Spectrum Label #6111
Conversation
…pread on a label or React-Spectrum Label
6100c2f
to
9866cf4
Compare
…rops-that-can-be-spread-on-a-label-or-react-spectrum-label
Build successful! 🎉 |
…rops-that-can-be-spread-on-a-label-or-react-spectrum-label
Build successful! 🎉 |
…rops-that-can-be-spread-on-a-label-or-react-spectrum-label
Build successful! 🎉 |
…rops-that-can-be-spread-on-a-label-or-react-spectrum-label
Build successful! 🎉 |
…rops-that-can-be-spread-on-a-label-or-react-spectrum-label
Build successful! 🎉 |
## API Changes
unknown top level export { type: 'any' } |
@@ -34,7 +34,7 @@ export interface SpectrumFieldProps extends SpectrumLabelPropsBase, SpectrumHelp | |||
children: ReactElement, | |||
label?: ReactNode, | |||
contextualHelp?: ReactNode, | |||
labelProps?: HTMLAttributes<HTMLElement>, | |||
labelProps?: LabelHTMLAttributes<HTMLLabelElement>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't this be not a label?
like,
<Label elementType="span" UNSAFE_className={classNames(styles, 'spectrum-ColorSlider-valueLabel')}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but LabeHTMLAttributes
extends HTMLAttributes
and the Label element takes care of whether htmlFor
should be added:
htmlFor={ElementType === 'label' ? labelFor || htmlFor : undefined}> |
Closes #6109
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project:
Adobe/Accessibility