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

Expose shouldRecycle property of vertical-collection #648

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion addon/components/light-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,17 @@ const LightTable = Component.extend({
*/
estimatedRowHeight: 0,

/**
* Whether `vertical-collection` should recycle table rows. This speeds up performance with occlusion
* rendering but may cause problems if any components expect to reset their state to the initial state
* with every rerender of the list.
*
* @property shouldRecycle
* @type Boolean
* @default true
*/
shouldRecycle: true,

/**
* Table component shared options
*
Expand All @@ -193,7 +204,8 @@ const LightTable = Component.extend({
fixedHeader: false,
fixedFooter: false,
occlusion: this.get('occlusion'),
estimatedRowHeight: this.get('estimatedRowHeight')
estimatedRowHeight: this.get('estimatedRowHeight'),
shouldRecycle: this.get('shouldRecycle')
};
}).readOnly(),

Expand Down
1 change: 1 addition & 0 deletions addon/templates/components/lt-body.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
rows
tagName='vertical-collection'
estimateHeight=sharedOptions.estimatedRowHeight
shouldRecycle=sharedOptions.shouldRecycle
bufferSize=scrollBufferRows
containerSelector='.lt-scrollable'
firstVisibleChanged=(action 'firstVisibleChanged')
Expand Down