-
Notifications
You must be signed in to change notification settings - Fork 71
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
Slider #3296
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 9696f42 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Storybook Preview Link https://402bc2d1.saltdesignsystem-storybook.pages.dev |
input example + aria label types and refactor prettier self review + cs update tooltip css typedocs + change label prop to marks Slider Cypress / QA Tests (#3353) [WIP] Slider range (#3451) validation example update cs prettier + qa tests prevent default update mouse to pointer fix types type error explaination for type issue range slider cypress tests prettier typo update thumb tooltip behaviour
return { | ||
trackProps: { | ||
onPointerDown(event: MouseEvent) { | ||
//@ts-ignore - React MouseEvent not compatible with global mouse event, causing type error on SliderTrack |
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.
getValue
could take in specific values, instead of full event
to get this working
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.
do you know why this isn't casing a type error in usePointerDownThumb, line33 - it's using the same getValue function and also passing a pointer event.
When I try passing clientX to the getValue function, it still seems to be passing the event for some reason
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.
if you pass clientX
instead of the event, the types of events wont conflict
className={clsx(withBaseName("tooltip"), { | ||
[withBaseName("showTooltip")]: activeThumb === index, | ||
})} | ||
aria-expanded={activeThumb === index ? true : false} |
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.
aria-expanded={activeThumb === index ? true : false} | |
aria-expanded={activeThumb === index} |
min, | ||
max, | ||
step, | ||
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.
event | |
event.clientX |
trackProps: { | ||
onPointerDown(event: MouseEvent) { | ||
//@ts-ignore - React MouseEvent not compatible with global mouse event, causing type error on SliderTrack | ||
const newValue: number = getValue(trackRef, min, max, step, 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.
const newValue: number = getValue(trackRef, min, max, step, event); | |
const newValue: number = getValue(trackRef, min, max, step, event.clientX); |
return { | ||
trackProps: { | ||
onPointerDown(event: MouseEvent) { | ||
//@ts-ignore - React MouseEvent not compatible with global mouse event, causing type error on SliderTrack |
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.
if you pass clientX
instead of the event, the types of events wont conflict
return newValue; | ||
}; | ||
step: number, | ||
event: MouseEvent |
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.
event: MouseEvent | |
clientX: number |
No description provided.