 : find-row-index ( value table -- n/f )
     [ model>> value>> ] [ renderer>> '[ _ row-value ] map index ] bi ;
 
-: initial-selected-indices ( table -- n/f )
+: initial-selected-indices ( table -- {n}/f )
     {
         [ model>> value>> empty? not ]
         [ selection-required?>> ]
-        [ drop V{ 0 } ]
+        [ drop V{ 0 } clone ]
     } 1&& ;
 
 : (update-selected-indices) ( table -- {n}/f )

    new-line-gadget
        swap >>renderer
        swap >>model
        f <model> >>selected-values
        sans-serif-font >>font
        focus-border-color >>focus-border-color
        transparent >>column-line-color ; inline

: >>selected-index ( table n -- table ) over (>>selected-index) ;
: >>selected-value ( table val -- table ) over (>>selected-value) ;

M: table selected-value>> selected-values>> [ [ f ] [ peek ] if-empty ] <arrow> ;
M: table (>>selected-value) [ [ 1vector ] <arrow> ] dip (>>selected-values) ;
M: table selected-index>> selected-indices>> [ f ] [ peek ] if-empty ;
M: table (>>selected-index) [ 1vector ] dip (>>selected-indices) ;

IN: ui.gadgets.tables
