From 9fc0b62803dc72abb95cf94604e19f94d2b7c621 Mon Sep 17 00:00:00 2001 From: Protected Date: Tue, 13 May 2025 13:18:03 +0000 Subject: [PATCH] Fix for FixedLayout.index returning incorrect values depending on position in spread. (#59) --- fixed-layout.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fixed-layout.js b/fixed-layout.js index b2adeba..bf713da 100644 --- a/fixed-layout.js +++ b/fixed-layout.js @@ -234,14 +234,14 @@ export class FixedLayout extends HTMLElement { else { if (last.center || last.left) newSpread().right = section else if (last.right || !i) last.left = section - else last .right = section + else last.right = section } return arr }, [{}]) } get index() { const spread = this.#spreads[this.#index] - const section = spread?.center ?? (this.side === 'left' + const section = spread?.center ?? (this.#side === 'left' ? spread.left ?? spread.right : spread.right ?? spread.left) return this.book.sections.indexOf(section) }