Skip to content
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

majornista
Copy link
Collaborator

Closes #6109

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue #6109.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

Adobe/Accessibility

@majornista majornista force-pushed the 6109-spectrumfieldprops-should-return-labelprops-that-can-be-spread-on-a-label-or-react-spectrum-label branch from 6100c2f to 9866cf4 Compare March 28, 2024 17:52
…rops-that-can-be-spread-on-a-label-or-react-spectrum-label
@rspbot
Copy link

rspbot commented Apr 1, 2024

…rops-that-can-be-spread-on-a-label-or-react-spectrum-label
@rspbot
Copy link

rspbot commented Apr 1, 2024

…rops-that-can-be-spread-on-a-label-or-react-spectrum-label
@rspbot
Copy link

rspbot commented Apr 2, 2024

…rops-that-can-be-spread-on-a-label-or-react-spectrum-label
@rspbot
Copy link

rspbot commented Apr 2, 2024

…rops-that-can-be-spread-on-a-label-or-react-spectrum-label
@rspbot
Copy link

rspbot commented Apr 2, 2024

@rspbot
Copy link

rspbot commented Apr 2, 2024

## API Changes

unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }

@yihuiliao yihuiliao merged commit 0e61098 into main Apr 2, 2024
27 checks passed
@yihuiliao yihuiliao deleted the 6109-spectrumfieldprops-should-return-labelprops-that-can-be-spread-on-a-label-or-react-spectrum-label branch April 2, 2024 23:49
@@ -34,7 +34,7 @@ export interface SpectrumFieldProps extends SpectrumLabelPropsBase, SpectrumHelp
children: ReactElement,
label?: ReactNode,
contextualHelp?: ReactNode,
labelProps?: HTMLAttributes<HTMLElement>,
labelProps?: LabelHTMLAttributes<HTMLLabelElement>,
Copy link
Member

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')}>

Copy link
Collaborator Author

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}>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SpectrumFieldProps should return labelProps that can be spread on a label or React-Spectrum Label
6 participants