Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Item Height #28

Closed
AndreBastos23 opened this issue Jan 2, 2018 · 5 comments
Closed

Item Height #28

AndreBastos23 opened this issue Jan 2, 2018 · 5 comments

Comments

@AndreBastos23
Copy link

Version

Here's what went wrong:

Is it possible to set the item height as auto? I have diferent values coming from the DB and right now they are overlapping each other, since there is strings that contain only a few characters, and some that are more long.
Very good library btw :)

@Aidurber
Copy link
Owner

Aidurber commented Jan 2, 2018

Hi Andre,
Not currently, this is due to react-tiny-virtual-list. Item heights are required to correctly calculate when an item should render.

There is a discussion in #26 about swapping out react-tiny-virtual-list for react-virtualized. It's offers a wide range of different options such as an autosizer and a cellsizer. I'm going to take a look either tonight or tomorrow night at swapping it out to provide a more dynamic virtual list.

Failing finding a nice solution with a nice API, for our needs. Is to remove the internal usage of virtualised lists and leave that up to the developer with a render prop.
Thanks for the issue and the kind words 😃

@Aidurber
Copy link
Owner

Aidurber commented Jan 2, 2018

After swapping out react-tiny-virtual-list for react-virtualized using the CellMeasurer and AutoSizer components. Dynamic heights with the render prop are possible.
I'll be fixing #26 too before it goes out though.

Here is an example (no more cutting off!):
variable height

@AndreBastos23
Copy link
Author

That's awesome, that's really what i need.
I Was going to fork this because i need some more customization, but maybe you have interest in doing this.
Right now, you set the string "x selected" statically. I think you should let people decide what to concat when X elements are selected. For example, right now there is no way to change the string values to my native language. I think a simple prop would resolve this, and this would be more customizable for everyone. Just food for thought :p.

Maybe even pass a object with all the strings you can change, with your values as defaults.

@Aidurber
Copy link
Owner

Aidurber commented Jan 3, 2018

Yeah I can make a prop for that, no problem. See #29

@Aidurber
Copy link
Owner

Aidurber commented Jan 3, 2018

I think there are only 2 hard coded strings:

  • placeholder - which has a prop.
  • x selected - which will have a prop.

Do you think the prop would suffice? @AndreBastos23

@Aidurber Aidurber closed this as completed Jan 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants