Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sticky position with horizontal true #166

Closed
skopz356 opened this issue Aug 31, 2023 · 2 comments
Closed

Sticky position with horizontal true #166

skopz356 opened this issue Aug 31, 2023 · 2 comments

Comments

@skopz356
Copy link

Is your feature request related to a problem? Please describe.
I would like to have a horizontal list with first item sticky.

Describe the solution you'd like
I would like an example how to implement it because when I tried edit this example with prop horizontal=true it does not work.

@inokawa
Copy link
Owner

inokawa commented Aug 31, 2023

Hi, I'm not sure this is your intended markup, but you can make horizontal version of the example like this:

2023-08-31.23.47.08.mov
<VList style={{ width: "100vw", height: 160 }} horizontal>
  {Array.from({ length: 100 }).map((_, i) => {
    return (
      <div
        key={i}
        style={{
          display: "flex",
          flexDirection: "row",
          borderBottom: "solid 1px #ccc",
        }}
      >
        {Array.from({ length: 10 }).map((_, j) => {
          const isGroupTop = j === 0;
          return (
            <div
              key={j}
              style={{
                width: 120,
                background: "#fff",
                ...(isGroupTop && {
                  left: 0,
                  width: 60,
                  position: "sticky",
                  borderRight: "solid 1px #ccc",
                }),
              }}
            >
              {isGroupTop ? i : `${i} - ${j}`}
            </div>
          );
        })}
      </div>
    );
  })}
</VList>;

@inokawa
Copy link
Owner

inokawa commented Sep 5, 2023

Close due to inactivity. Feel free to reopen it if you have any problems.

@inokawa inokawa closed this as completed Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants