     } 1|| ;
 
 M: table model-changed
-    nip dup update-selected-indices {
+    nip dup update-selected-indices [ V{ } clone ] unless* {
         [ >>selected-indices f >>mouse-index drop ]
-        [ peek show-row-summary ]
+        [ [ f ] [ peek ] if-empty show-row-summary ]
         [ drop update-selected-values ]
         [ drop relayout ]
     } 2cleave ;


: draw-selected-rows ( table -- )
    {
        { [ dup selected-indices>> not ] [ drop ] }
        [
            [ selected-indices>> ] [ selection-color>> gl-color ] [ ] tri
            [ swap row-bounds gl-fill-rect ] curry each

: find-row-index ( value table -- n/f )
    [ model>> value>> ] [ renderer>> '[ _ row-value ] map index ] bi ;

: initial-selected-indices ( table -- {n}/f )
    {
        [ model>> value>> empty? not ]
        [ selection-required?>> ]
        [ drop V{ 0 } clone ]
    } 1&& ;

: (update-selected-indices) ( table -- {n}/f )
