ni / nimble

The NI Nimble Design System
https://nimble.ni.dev
MIT License
32 stars 8 forks source link

Consider using scrollbar-gutter where useful when available #1271

Open rajsite opened 1 year ago

rajsite commented 1 year ago

🧹 Tech Debt

The scrollbar-gutter CSS feature allows you to reserve space in a component for a scrollbar. It's aware of system-specific details about scrollbars such as scrollbar size and if the scrollbars are overlay or classic.

Unfortunately currently blocked on Safari support. Caniuse

When available we should be able to use it to remove the complexity of scrollbar tracking in the nimble-text-area:

https://github.com/ni/nimble/blob/14402b0d2e2a8a56454f79aa971324bf96dea5fe/packages/nimble-components/src/text-area/index.ts#L123-L126

msmithNI commented 1 year ago

The table virtualizer is another place that has similar code that we might be able to revisit: https://github.com/ni/nimble/blob/14402b0d2e2a8a56454f79aa971324bf96dea5fe/packages/nimble-components/src/table/models/virtualizer.ts#L51