Stay up to date with AI tools, model releases, and developer workflows that matter.

Weekly. Free. One click to leave.

In a recent development, 7 Day Free Trial. Cancel Anytime.

Picture a keyboard user shopping for leggings. They tab through 40 product tiles, press "See more" twice, and open the 63rd item. It isn't quite right, so they press Back.

A mouse user lands roughly where they left off. The keyboard user's focus is back at the top of the page, on the skip link or the logo. A screen reader user hears the page title and starts over from the header. To get back to tile 63, they have to tab past the navigation, the filters, and 62 products, and only if the "See more" content is still there.

Recent findings suggest that this happens on most product listing pages (PLPs), and an automated scanner won't flag it. Every element on the page passes. What's missing is the journey. This post explains why it happens and how to fix it with a small, framework-agnostic pattern.

Browsers handle Back by restoring scroll position, which is a purely visual cue. Keyboard focus and a screen reader's reading position aren't reliably restored. Which one breaks depends on how the page was built:.

Sources indicate that • Multi-page apps (classic server-rendered PLPs). A Back that misses the back/forward cache (bfcache) reloads the page from scratch. Scroll may come back, but focus starts at the document. A bfcache hit keeps the DOM, but browsers and screen readers still vary in where focus and the virtual cursor land.

In a recent development, •  Single-page apps (React, Next.js, Vue). The router re-renders the grid on popstate. The old tile element no longer exists, so the focus that was on it is gone and moves to body.

Industry observers note that •  "See more" and infinite scroll. Tiles loaded by a click exist only in memory. After Back, the page often renders just the first batch, so the tile the user opened isn't in the DOM at all. Scroll restoration fails too, and focus has nowhere to go.

A sighted mouse user can scan the grid and find their place again. A keyboard or screen reader user can only find it by moving through every element before it.

According to recent reports, the task still works by keyboard, but only by tabbing back through dozens of stops. That's the cost this fix removes.

Treat this as a usability defect with WCAG backing, not a checkbox. That's how to frame it for product owners too: mouse people already get this behavior, and keyboard and screen reader users don't.

According to recent reports, 1. Remember which product the user opened and how many tiles were loaded, just before they leave the PLP.

2. Detect that they arrived back via Back or Forward, not from a fresh link.

In a recent development, 3. Rebuild the grid to the same depth, including tiles revealed by "See more.".

Industry observers note that 4. Focus the link inside the original tile, scroll it into view, and clear the saved state.

Sources indicate that listen for clicks on the grid. Pressing Enter on a link also fires click, so this one listener covers both keyboard and mouse owners. Key the saved state to the PLP's URL so a return to a different category doesn't pick it up.

const KEY = 'plp-return'; const grid = document.querySelector('[data-product-grid]'); grid.addEventListener('click', (event) => { const link = event.target.closest('a[data-product-id]'); if (!link) return; sessionStorage.setItem(KEY, JSON.stringify({ url: location.pathname + location.search, productId: link.dataset.productId, loaded: grid.querySelectorAll('a[data-product-id]').length, })); });.

According to recent reports, pageshow fires both on a normal load and on a bfcache restore. event.persisted is true for a bfcache restore. For a full reload, the Navigation Timing entry reports back_forward.

function isBackForward(event) { if (event.persisted) return true; const [nav] = performance.getEntriesByType('navigation'); return nav?.type === 'back_forward'; } window.addEventListener('pageshow', async (event) => { if (!isBackForward(event)) return; const saved = JSON.parse(sessionStorage.getItem(KEY) || 'null'); if (!saved || saved.url !== location.pathname + location.search) return; sessionStorage.removeItem(KEY); await ensureLoaded(saved.loaded); // see the next section const link = grid.querySelector( a[data-product-id="${CSS.escape(saved.productId)}"] ); if (!link) { focusGridHeading(); // product sold out or filtered away return; } link.focus({ preventScroll: true }); link.scrollIntoView({ block: 'center' }); });.

•         Focus the link, not the card. The link is already in the tab order and has an accessible name, so a screen reader introduces the product's name and nothing else. Don't add tabindex="-1" to the card's wrapper div.

It has been revealed that •         Separate the focus from the scroll. preventScroll followed by scrollIntoView({ block: 'center' }) keeps the tile clear of a sticky header. Also add scroll-margin-top to the tiles to meet 2.4.11.

It has been revealed that •         Have a fallback. If the product is gone, give the grid's heading tabindex="-1" and move focus there. Never leave focus on body.

In an SPA, pageshow doesn't fire on route changes. Flag the return on popstate, then restore focus after the grid has rendered its products.

let cameBack = false; if (typeof window !== 'undefined') { window.addEventListener('popstate', () => { cameBack = true; }); } export function useReturnFocus(gridRef, products, ensureLoaded) { useEffect(() => { if (!cameBack || products.length === 0) return; const saved = JSON.parse(sessionStorage.getItem(KEY) || 'null'); if (!saved || saved.url !== location.pathname + location.search) return; cameBack = false; sessionStorage.removeItem(KEY); ensureLoaded(saved.loaded).then(() => { requestAnimationFrame(() => { const link = gridRef.current?.querySelector( a[data-product-id="${CSS.escape(saved.productId)}"] ); if (link) { link.focus({ preventScroll: true }); link.scrollIntoView({ block: 'center' }); } }); }); }, [products.length]); }.

It has been revealed that you may be tempted to keep this state in history.state instead. Next.js and other routers manage history.state themselves, and writing to it can collide with them. A sessionStorage entry keyed by URL is the safer choice.

The hardest case is a tile that wasn't in the first batch. The most reliable fix is to put the grid's depth in the URL. Each time "See more" loads a batch, update the query string with replaceState:.

async function onSeeMore() { const next = await loadNextBatch(); const url = new URL(location.href); url.searchParams.set('shown', grid.querySelectorAll('a[data-product-id]').length); history.replaceState(history.state, '', url); next.firstLink?.focus(); // move focus to the first new tile }.

Now the server, or the SPA's data loader, can render the right number of tiles on Back, and ensureLoaded() has little left to do. As a bonus, a shared or bookmarked link reopens the grid at the same depth.

In a recent development, if you can't change the URL, ensureLoaded(count) should fetch batches until the grid holds count tiles. Cap it so a slow network can't hang the page. If the cap is hit, use the heading fallback.

Sources indicate that the last line of onSeeMore matters too. After "See more," focus belongs on the first latest tile, not on a button that may have moved or disappeared. It's the same problem in the other direction: the user should never lose their place in the grid.

Automated tools can't see this bug, so test it by hand. Run each scenario with the keyboard alone, then with a screen reader:.

•         Open a tile in the first batch, press Back: focus is on that tile's link and it's visible.

•         Open a tile revealed by "See more" (twice), press Back: the same tile, at the same depth.

•         Apply a filter and a sort, open a tile, press Back: filters, sort and focus all survive.

•         Press Back, then Forward, then Back again: focus is still correct and nothing is restored twice.

•         Reach the PLP from a fresh link (not Back): focus starts at the top as normal.

•         Remove the product from the results, press Back: focus lands on the grid heading, not body.

•        Check the focused tile isn't hidden under a sticky header (2.4.11).

•         Throttle the network to Slow 4G: restoration still completes, or falls back cleanly.

Cover the pairings your consumers actually use: NVDA with Chrome or Firefox, JAWS with Chrome, and VoiceOver with Safari on macOS and iOS. Safari uses bfcache aggressively, so it's where the persisted branch gets exercised most.

A tab-order overlay such as my free Tab Order Visualizer Chrome extension makes it easy to confirm where focus lands and what the next Tab stop is.

Mouse consumers already get this behavior: Back returns them close to where they were. With about 40 lines of code, keyboard and screen reader users get it too. Remember the tile, detect the return, rebuild the grid and focus the link.

It's also a reminder of what audits miss. A page can pass every automated rule and still make someone tab through 60 products to get back to where they were. Accessibility lives in the journey between pages, not only in each element on them, so test the journey.

It has been revealed that have you run into this on your own PLPs? I'd like to hear how your team handled it, especially with infinite scroll.

It has been revealed that 7 Day Free Trial. Cancel Anytime.

📌 Read also:

→ Read original article