# 12.27 Keep the selection through scroll and filter

> Chapter 12, Pointer and keyboard. Section: Selection. Guide: https://www.designguide.dev/md/12-pointer-and-keyboard.md#keep-the-selection-through-scroll-and-filter

Default

**Rule:** Keep the selection when the list scrolls or sorts, apply select all to the filtered rows only, and clear it with Esc.

**Why:** Losing rows on scroll, or selecting hidden rows, causes a wrong bulk action.

- Use a header checkbox with three states: none, some, and all.
- Show a selected row with a fill and bold weight, not color alone.
- Show the count in a bar that stays in view.

**Picture:** Figure: Three rows stay selected under the Open filter, with a count bar.
