clauderic / react-tiny-virtual-list

A tiny but mighty 3kb list virtualization library, with zero dependencies 💪 Supports variable heights/widths, sticky items, scrolling to index, and more!
https://clauderic.github.io/react-tiny-virtual-list/
MIT License
2.47k stars 164 forks source link

className support [feature request] #51

Closed damianobarbati closed 6 years ago

damianobarbati commented 6 years ago

I was trying to hide/style scrollbars on Windows/Chrome but I noticed that my className is swallowed and not applied!

    //in @injectSheet
    tbody: {
        width: '100%',
        '&::-webkit-scrollbar': {
            width: 0, // remove scrollbar space
            background: 'transparent', // make scrollbar invisible
        },
    },

   //in render
        <VirtualList
            id={'tableBody'}
            className={classes.tbody} //my class with styles for scrollbars here in classes.tbody
            height={tbodyHeight}
            ....
clauderic commented 6 years ago

The className prop is passed through to the wrapper container, along with all other extra attributes https://github.com/clauderic/react-tiny-virtual-list/blob/master/src/index.tsx#L313

You must be having issues with your CSS-in-JS library.

damianobarbati commented 6 years ago

Yes you're right, I just confirmed it and I was about to close this. Sorry for the noise!