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

Slider #3296

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Slider #3296

wants to merge 10 commits into from

Conversation

lukeac123
Copy link
Contributor

@lukeac123 lukeac123 commented Apr 24, 2024

No description provided.

Copy link

changeset-bot bot commented Apr 24, 2024

🦋 Changeset detected

Latest commit: 9696f42

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@salt-ds/lab Minor

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

Copy link

vercel bot commented Apr 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
saltdesignsystem ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 3, 2024 3:52pm

Copy link
Contributor

github-actions bot commented Apr 24, 2024

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
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
aria-expanded={activeThumb === index ? true : false}
aria-expanded={activeThumb === index}

min,
max,
step,
event
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
event: MouseEvent
clientX: number

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.

None yet

4 participants