diff --git a/src/app.jsx b/src/app.jsx index c176a150..09c1b649 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -138,11 +138,24 @@ function App() { }; const focusDeck = () => { let timer = setTimeout(() => { - const page = document.getElementById(locationDeckMap[location.pathname]); - console.debug('FOCUS', location.pathname, page); - if (page) { - page.focus(); + const columns = document.getElementById('columns'); + if (columns) { + // Focus first column + columns.querySelector('.deck-container')?.focus?.(); + } else { + // Focus last deck + const pages = document.querySelectorAll('.deck-container'); + const page = pages[pages.length - 1]; // last one + if (page && page.tabIndex === -1) { + console.log('FOCUS', page); + page.focus(); + } } + // const page = document.getElementById(locationDeckMap[location.pathname]); + // console.debug('FOCUS', location.pathname, page); + // if (page) { + // page.focus(); + // } }, 100); return () => clearTimeout(timer); }; diff --git a/src/pages/followed-hashtags.jsx b/src/pages/followed-hashtags.jsx index 4c627583..21e0f290 100644 --- a/src/pages/followed-hashtags.jsx +++ b/src/pages/followed-hashtags.jsx @@ -39,7 +39,7 @@ function FollowedHashtags() { }, []); return ( -