primitives icon indicating copy to clipboard operation
primitives copied to clipboard

Scroll Area component - can expose a data attribute when scroll bar is visible?

Open Roeefl opened this issue 1 year ago • 2 comments

Would it be possible to have the Scroll Area component expose a data attribute (or in any other way) when the scroll bar is visible or not?

Overview

Currently we've implemented a custom solution to achieve that knowledge, would be great if it would be possible to assess without it.

Who does this impact? Who is this for?

We believe this would be useful for many consumers...

Roeefl avatar Jan 31 '24 12:01 Roeefl

It's exposed via the type prop. See for options

<ScrollArea.Root type="always" ... >
    ...
</ScrollArea.Root>

work-in-progress-danny avatar Feb 12 '24 00:02 work-in-progress-danny

@Danny-Duck Thank you, but I'm not sure we're relating to the same thing. I don't want to set the scroll bar behaviour, but rather to be able just to know whether it's displayed or not, not by having it always display.

Roeefl avatar Feb 13 '24 11:02 Roeefl

@Roeefl there is a data-state attribute for that already: CleanShot 2024-03-01 at 21 03 35@2x

benoitgrelard avatar Mar 01 '24 21:03 benoitgrelard