GuillaumeJasmin / react-table-hoc-fixed-columns

ReactTable HOC for fixed columns
MIT License
113 stars 41 forks source link

`fixed: left` with 2 columns fails in v2+ #59

Closed markwoon closed 4 years ago

markwoon commented 4 years ago

After migrating from 1.x to 2.x I noticed that fixed: left with more than one column is broken.

This is what I expected:

good

This is what I got (notice the column title Variant gets pushed over to the next column):

bad

Until I figure out a way to patch this and get react-table and react-table-6 to co-exist, you can see this problem at https://www.pharmgkb.org/chemical/PA10026/variantAnnotation

Deleting line 136 and 151 in stickyPosition/index.js seems to fix the problem for me.

If this issue can't be resolved in a timely manner, would you be able to release a version of 1.x with the fix for #58?

Thanks.

GuillaumeJasmin commented 4 years ago

Hi, Thanks for your feedback ! Can you reproduce your issue with code sandbox example ? I think it’s just a config issue in your columns props. Or just copy/past your config here

V1 should works with react-table-v6 because #58 only exist on v2, because I used react-table dependency on v2 but not on v1. Have you try v1 and react-table-v6 together ?

markwoon commented 4 years ago

You're right, v1 works just fine. I should have checked myself.

Here's a quick and dirty example: https://codesandbox.io/s/awesome-bogdan-8rp83?fontsize=14&hidenavigation=1&theme=dark

I think this might just be a duplicate of #27.

GuillaumeJasmin commented 4 years ago

You have to import styles of fixed-columns after styles of react-table, like this:

import "react-table-6/react-table.css";
import "react-table-hoc-fixed-columns/lib/styles.css";

That will fix your UI issue.

Also, in your example, all your columns are fixed: "left" which is useless ? remove fixed on lastname and that works

markwoon commented 4 years ago

You are right. I ordered the stylesheets incorrectly.