diff --git a/plugin.js b/plugin.js index 51e29d2..94bb903 100644 --- a/plugin.js +++ b/plugin.js @@ -98,10 +98,15 @@ var cards = g.find('.card.selector'); if (!cards.length) return; + // Re-register controller on every call, but only reset focus the FIRST time + // (so an async catalog load / late retry does not yank focus back to card[0]). + var first = !apply._inited; + apply._inited = true; + Lampa.Controller.add('content', { toggle: function () { Lampa.Controller.collectionSet(g); - Lampa.Controller.collectionFocus(cards[0], g); + if (first) Lampa.Controller.collectionFocus(cards[0], g); }, right: function () { Navigator.move('right'); }, left: function () {