Skip to content

Conversation

LukeFinch
Copy link
Contributor

PR Related to issue #109

This adds 2 props to the tree. virtualLines and autoHeight
Virtual lines sets the number of items in the virtual list. Auto Height will set the height of the virtual list container, based on the number of items.

This does however mean that if a user doesn't get autoHeight, they must style the container to have a height.

I have also updated the VirtualList.vue example, so show the new props.

@leezng
Copy link
Owner

leezng commented Mar 2, 2021

@LukeFinch
I'm sorry to find some problems, after running your modification:

  • When I turn off autoHeight, there will be a large area of blank space in the virtual list of the page.
  • When I change the virtualLines to 20, and then scroll to the 20th line or so in the list, the component is rendered as blank.

The above problems can be found on the example page.

@LukeFinch
Copy link
Contributor Author

Thanks, I'll investigate.

With regards to autoHeight, it would require the user to set a height, using a css property if they set the prop to false.
Do you have a preferred method for implementing such a thing? Or would you recommend removing the autoHeight prop?

Investigating the other issue, it looks to be changing the translateY of state, and I'm guessing that the issue occurs when you change the virtualLines prop after it has mounted. The translateY jumps from 980 to 990000 when scrolling past a certain point.

@leezng
Copy link
Owner

leezng commented Mar 4, 2021

I think it needs to be split into 2 PRs to ensure that each PR corresponds to an independent demand and is easy to trace.

Can you help split it? The current PR is only to add virtualLines prop.

@LukeFinch
Copy link
Contributor Author

Just pushed changes removing auto height.

The issue still persists when changing the number of lines after the component has mounted.
Do you think this could be fixed with a watch effect? Re-render the component if the number of lines changes?

@leezng leezng merged commit 681628c into leezng:dev Mar 14, 2021
@leezng
Copy link
Owner

leezng commented Mar 14, 2021

This is a problem caused by the data type, I have fixed it. 8a4aa3f

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

Successfully merging this pull request may close these issues.

2 participants