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

Version 2 [WIP] #321

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Version 2 [WIP] #321

wants to merge 9 commits into from

Conversation

bvaughn
Copy link
Owner

@bvaughn bvaughn commented Sep 4, 2019

Resolves #302

@bvaughn
Copy link
Owner Author

bvaughn commented Sep 4, 2019

Not sure why Flow is failing on CI but not for me locally.

@nihgwu
Copy link
Contributor

nihgwu commented Sep 6, 2019

Really looking forward the new components, I'm planning to switch to use List instead of Grid for the next version of BaseTable, I chose Grid instead of List to implement the BaseTable at first because the List doesn't support horizontal scrolling.

I've worked out a prototype and it's really promising, especially the change on onScroll, now I can get scrollLeft for fixed mode(horizontal scrollable) without any workaround, but there is still a limitation there, can we add an extra prop like itemWidth or innerWidth to set the inner element's width, and the default value is 100%, although I can change the style directly, but that will break the memoization.

Another concern is about the key from the itemRenderer, I think it's me suggesting you to support callback instead of using index directly, but now as we switched to renderer, I think we could just remove itemKey, and let the users to set the key for item.

@bvaughn
Copy link
Owner Author

bvaughn commented Sep 6, 2019

Another concern is about the key from the itemRenderer, I think it's me suggesting you to support callback instead of using index directly, but now as we switched to renderer, I think we could just remove itemKey, and let the users to set the key for item.

Hm, I think we could remove the key attribute from the SimpleList renderer, and rely on users to attach it themselves. They may forget, although in that case React would warn them.

I wouldn't want to remove it from the List renderer though, since we also may want to cache other info on that same key (e.g. offset, size) in which case we'd want a stronger guarantee that the keys would never mismatch.

I think this PR is probably going to be put on hold anyway as I will probably end up trying to build more of this into react core where we can do more and more efficiently.

@nihgwu
Copy link
Contributor

nihgwu commented Sep 6, 2019

Then what about my first question? I understand you consideration the list should not be scrollable horizontally, but from my experience we need that feature in a lot of cases, btw I was talking about SimpleList above actually and use List for short

@bvaughn
Copy link
Owner Author

bvaughn commented Sep 7, 2019

Lists can be horizontally scrollable if you want to make them. Overriding width style should not break your memoization. (This is true of v1 and v2.) I'd like to keep this PR discussion centered around the new API if possible.

@HenrikBechmann
Copy link

@bvaughn "Lists can be horizontally scrollable if you want to make them."

I really hope that's true! My app depends on it.

Flexbox?

@ghost
Copy link

ghost commented Jan 22, 2020

@bvaughn Any update on this? Would v2 be released soon or I have to download this branch manually for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants