╭ changed ──────────╮ │src/embed/script.js│ ╰───────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │183 const top = first.top - c.top + container.scrollTop; │ │184 const bottom = last.bottom - c.top + container.scrollTop; │ │185 const left = first.left - c.left + container.scrollLeft; │ │186 + let right = left; │ │187 + for (const el of els) { │ │188 + right = Math.max(right, el.getBoundingClientRect().right - c.left + container.scrollLeft);│ │189 + } │ │190 │ │191 // vertical is the priority axis. keep the viewport in place when it │ │192 // already overlaps a tall widget; otherwise reveal its nearest edge. │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │197 } else if (bottom > container.scrollTop + container.clientHeight) { │ │198 container.scrollTop = bottom - container.clientHeight; │ │199 } │ │196 - // horizontal: only reveal the row's start, never chase the right edge, │ │197 - // so moving down through varying-width rows doesn't yank the view │ │198 - // sideways. (a hidden-overflow x axis stays at 0, so this no-ops.) │ │199 - if (left < container.scrollLeft) container.scrollLeft = left; │ │200 + // horizontal-only scrolls are rows of controls, so reveal either │ │201 + // edge. other scrolls reveal only the row's start; chasing varying │ │202 + // right edges while moving vertically would yank their view sideways. │ │203 + if (left < container.scrollLeft) { │ │204 + container.scrollLeft = left; │ │205 + } else if (container.dataset.scrollDirection === "horiz" && right > container.scrollLeft + container.clientWidth) {│ │206 + container.scrollLeft = right - container.clientWidth; │ │207 + } │ │208 }, │ │209 }, │ │210 }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯