wildcard icon indicating copy to clipboard operation
wildcard copied to clipboard

Don't remove non-row content in the row container

Open geoffreylitt opened this issue 4 years ago • 0 comments

Problem

When rows are sorted into a different order, any content that was in the row container which isn't part of the rows gets removed.

For example, on Hacker News, there's a "more" link at the bottom of the page, which disappears after sorting.

This happens because the way sorting works is that it empties out the row container and then re-inserts the rows in a new order.

Proposed solution

Instead of emptying out the row container: remove all the row elements, and then replace them with the new row elements.

Maybe use a crude heuristic to try to leave non-row elements in place -- for example, the "more" link is after all the rows, so it should stay after the new rows. (Perhaps a fancier approach would be to replace rows one-by-one in place)

geoffreylitt avatar Apr 05 '20 16:04 geoffreylitt