Skip to content

Ability to add custom scrollbar for VList #297

Answered by inokawa
adventofryz asked this question in Q&A
Discussion options

You must be logged in to vote

This looks working:

import SimpleBar from "simplebar-react";
import "simplebar-react/dist/simplebar.min.css";

const Root = forwardRef<HTMLDivElement, CustomViewportComponentProps>(
  ({ children, attrs, width, height, scrolling }, ref): ReactElement => {
    return (
      <SimpleBar scrollableNodeProps={{ref}} {...attrs}>
        <div
          style={useMemo((): CSSProperties => {
            return {
              position: "relative",
              visibility: "hidden",
              width: width ?? "100%",
              height: height ?? "100%",
              pointerEvents: scrolling ? "none" : "auto",
            };
          }, [width, height, scrolling])}
        >
          {chi…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@adventofryz
Comment options

@EjovA
Comment options

@adventofryz
Comment options

@EjovA
Comment options

Answer selected by adventofryz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #296 on December 26, 2023 13:45.