Skip to content

Commit 2062235

Browse files
committed
[nested-v-grid] Fix bounds of exported cells & headers
1 parent 2e3f795 commit 2062235

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/re_com/nested_v_grid.cljs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -437,31 +437,31 @@
437437
:when (or leaf? show?)
438438
:let [showing-row-path (cond-> showing-row-path (not show-root-headers?) (subvec 1))
439439
this-depth (count showing-row-path)]]
440-
(for [i (cond-> (range @row-depth) (not show-root-headers?) rest)
441-
:let [row-path (subvec showing-row-path 0 (min i this-depth))
440+
(for [i (range @row-depth)
441+
:let [row-path (subvec showing-row-path 0 (min (inc i) this-depth))
442442
{:keys [branch-end?]} (meta row-path)
443443
props {:row-path row-path
444444
:path row-path
445445
:branch-end? branch-end?}]]
446446
(on-export-row-header props)))
447-
column-headers (for [i (cond-> (range @column-depth) (not show-root-headers?) rest)]
447+
column-headers (for [i (range @column-depth)]
448448
(for [showing-column-path (cond-> column-paths (not show-root-headers?) rest)
449449
:let [{:keys [leaf? show?]} (meta showing-column-path)]
450450
:when (or leaf? show?)
451451
:let [showing-column-path (cond-> showing-column-path (not show-root-headers?) (subvec 1))
452452
this-depth (count showing-column-path)
453-
column-path (subvec showing-column-path 0 (min i this-depth))
453+
column-path (subvec showing-column-path 0 (min (inc i) this-depth))
454454
{:keys [branch-end?]} (meta column-path)
455455
props {:column-path column-path
456456
:path column-path
457457
:branch-end? branch-end?}]]
458458
(on-export-column-header props)))
459-
corner-headers (for [row-index (cond-> (range @column-depth) (not show-root-headers?) rest)]
460-
(for [column-index (cond-> (range @row-depth) (not show-root-headers?) rest)
461-
:let [props {:row-index (cond-> row-index (not show-root-headers?) dec)
462-
:column-index (cond-> column-index (not show-root-headers?) dec)
463-
:row-depth (cond-> @row-depth (not show-root-headers?) dec)
464-
:column-depth (cond-> @column-depth (not show-root-headers?) dec)}
459+
corner-headers (for [row-index (range @column-depth)]
460+
(for [column-index (range @row-depth)
461+
:let [props {:row-index row-index
462+
:column-index column-index
463+
:row-depth @row-depth
464+
:column-depth @column-depth}
465465
props (merge props {:edge (corner-header-edges props)})]]
466466
(on-export-corner-header props)))
467467
cells (for [row-path row-paths

0 commit comments

Comments
 (0)