-
Notifications
You must be signed in to change notification settings - Fork 318
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
chore(ui-react): lint primitives (P-S) #3265
Conversation
🦋 Changeset detectedLatest commit: f944eab The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: Scott Rees <6165315+reesscot@users.noreply.github.com>
Co-authored-by: Scott Rees <6165315+reesscot@users.noreply.github.com>
@@ -43,7 +43,6 @@ const SliderFieldPrimitive: Primitive<SliderFieldProps, typeof Root> = ( | |||
testId, | |||
thumbColor, | |||
trackSize, | |||
dir, |
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.
Are we sure we didn't mean to throw this prop away?
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.
It was unused, so technically it's no longer being thrown away 😄
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.
Yeah, that should have been getting passed through, so your change looks correct:
https://www.radix-ui.com/docs/primitives/components/slider#root
…nd onStepChange type description
db4808c
to
a413f6a
Compare
@@ -20,7 +28,10 @@ export const useSwitch = (props: UseSwitchProps) => { | |||
return; | |||
} | |||
|
|||
typeof onChange === 'function' && onChange(event); | |||
if (typeof onChange === 'function') { |
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.
We have a isFunction
util under shared
folder
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.
Really trying not to get in to refactoring in these PRs to prevent scope creep from kicking in
packages/react/src/primitives/SearchField/__tests__/SearchField.test.tsx
Outdated
Show resolved
Hide resolved
setInputValue(event.target.value); | ||
|
||
if (typeof onChange === 'function') { | ||
onChange(event); |
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.
Just a note that this is a bug fix, previous to this PR onChange
props passed to StepperField
was never called
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.
Good catch
* TODO: | ||
* Extends StepperField props from Omit<TextFieldProps, 'onChange'>, after removing [key: string]: any from the base type | ||
* and rename onStepChange to onChange |
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.
This was being rendered in the docs StepperField
props table
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.
🤦♂️
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.
LGTM, thanks for catching these issues
Description of changes
Lint all React UI primitives and related files between
P
andS
Issue #, if available
NA
Description of how you validated changes
yarn react lint && yarn react test
Checklist
yarn test
passessideEffects
field updatedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.