Ensure selected items always mounted

Author: pekalaCreated Dec 2, 2025Updated Dec 2, 2025

In my usecase items in the virtually scrolled list have input fields where you can type. In some cases the user would start typing, and then scroll the list far enough for the input to move out of virtual viewport and unmount, but they'd expect to be able to continue to type. It would be great if there was a prop which would ensure that items in the list with a given indices won't unmount even if scrolled out of the virtual viewport. This way I could dynamically modify this prop to ensure the item with a focused input field stays mounted regardless of the list scroll position.

Happy to contribute this, let's me know your thoughts!