Polymer / polymer

Our original Web Component library.
https://polymer-library.polymer-project.org/
BSD 3-Clause "New" or "Revised" License
22.05k stars 2.01k forks source link

Ensure limit is reset when initialCount is disabled. #5640

Closed kevinpschaaf closed 4 years ago

kevinpschaaf commented 4 years ago

Resolves a corner-case issue with the previous fix in #5632, where rendering an empty list (items.length===0), setting the initialCount to 0, and then attempting to render a list with items.length > 0 could cause the list to be stuck in an unrendered state.

Note that any falsey value for initialCount (including 0) is interpreted as "chunking disabled". This is consistent with 1.x logic, and follows from the logic of "starting chunking by rendering zero items" doesn't really make sense.

Also took the opportunity while adding a new test to refactor the chunking tests to use async/await for better readability.

Reference Issue

Fixes #5631