-
-
Notifications
You must be signed in to change notification settings - Fork 370
Open
Labels
component: sliderChanges related to the slider component.Changes related to the slider component.support: questionCommunity support but can be turned into an improvement.Community support but can be turned into an improvement.
Description
Get help
Ask a question
Developers using our Base UI based design system were confused as to why in order to select a Slider.Thumb in a test, one must use { hidden: true }:
expect(screen.getByRole('slider', { hidden: true })).toBeInTheDocument()
I noticed these lines must be the cause: https://github.com/mui/base-ui/blob/master/packages/react/src/slider/thumb/SliderThumb.tsx#L251-L254
return {
['--position' as string]: `${positionPercent}%`,
visibility:
(renderBeforeHydration && !isMounted) || positionPercent === undefined
? 'hidden'
: undefined,
I can't explain why this condition exists and if there is a way around this to keep our tests clean (and avoid using { hidden: true } ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
component: sliderChanges related to the slider component.Changes related to the slider component.support: questionCommunity support but can be turned into an improvement.Community support but can be turned into an improvement.