-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fixing combobox to use useFormProps and related component refactors #2351
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
Changes from all commits
0d525b6
47fdd60
f0cda1c
76edf46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,9 +20,7 @@ import {PressEvents} from '@react-types/shared'; | |
| import React, {cloneElement, forwardRef, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactElement, Ref, RefObject, TextareaHTMLAttributes, useImperativeHandle, useRef} from 'react'; | ||
| import {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield'; | ||
| import styles from '@adobe/spectrum-css-temp/components/textfield/vars.css'; | ||
| import {useFormProps} from '@react-spectrum/form'; | ||
| import {useHover} from '@react-aria/interactions'; | ||
| import {useProviderProps} from '@react-spectrum/provider'; | ||
|
|
||
| interface TextFieldBaseProps extends Omit<SpectrumTextFieldProps, 'onChange'>, PressEvents { | ||
| wrapperChildren?: ReactElement | ReactElement[], | ||
|
|
@@ -39,8 +37,6 @@ interface TextFieldBaseProps extends Omit<SpectrumTextFieldProps, 'onChange'>, P | |
| } | ||
|
|
||
| function TextFieldBase(props: TextFieldBaseProps, ref: Ref<TextFieldRef>) { | ||
| props = useProviderProps(props); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how'd we remove useProviderProps from this one? but not from SearchWithin?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. useProviderProps is useful for a component that is being rendered directly like SearchWithin. If it is a child like TextFieldBase which other components use as a child, this call doesn't do anything. And useProviderProps can't exist here and not in the parent. useProviderProps must be in the parent. It we had Storybook tests of TextFieldBase we would need this useProviderProps call.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO I think we are ok pulling
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On second thought,
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to remind myself, I move Looking at SearchWithin it seems like it shouldn't need I think there is a bug. I'm debugging the code and found that calling but calling the props after |
||
| props = useFormProps(props); | ||
| let { | ||
| label, | ||
| validationState, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.