Shauny
(Shaun Robinson)
12. Mai 2026 um 21:12
1
Wenn du ein Raster verwendest, auf das erste Element klickst und dann die Pfeiltasten verwendest, um durch sie zu navigieren, erfolgt die Reihenfolge nicht in der Reihenfolge, in der du sie hochgeladen hast, sondern in einer anderen. Probiere es unten aus:
Die Reihenfolge ist: 1, 3, 2, 4
3 „Gefällt mir“
Danke @Shauny für den Bericht. Das Debuggen und Beheben hat Spaß gemacht
main ← fix-grid-lightbox-order
opened 09:15AM - 13 May 26 UTC
Inside a `[grid]` block, the lightbox arrow navigation followed column-balanced … DOM order instead of the original markdown order. For four images this resulted in 1, 3, 2, 4 because `Columns` distributes items by height into the shortest column.
`lightbox.js` collects items via `querySelectorAll(".lightbox")`, which returns nodes in document order — the same scrambled order the layout algorithm produced.
`Columns` now tags each item with `data-lightbox-position` carrying its original index before reordering. A new `sortLightboxItems` helper in `lightbox.js` reorders items within each grid by that attribute before they reach PhotoSwipe. The existing RTL reverse continues to apply on top, so right-to-left navigation now mirrors logical order rather than the scrambled layout.
https://meta.discourse.org/t/402817
cc @davidb
4 „Gefällt mir“