pota/use/selectionpota/use/selection covers these needs: the
clickSelectsAll ref function that
selects an element's text on click, and
getSelection /
restoreSelection for
round-tripping a Range (used internally by use:bind
to keep contenteditable cursors stable across re-renders).
clickSelectsAll — use:ref
function: select all text on clickgetSelection() — snapshot the
current selection as a RangerestoreSelection(range) —
reapply a captured Range