fix: restore Related Stories resize focus
This commit is contained in:
5 files changed
+24
-37
No files matched your search
@@ -96,7 +96,7 @@ A dedicated `assets/js/related-posts.js` controller enhances every rendered caro
|
||||
- The script does not autoplay, loop, clone cards, modify card links, export globals, or make network requests.
|
||||
- Missing markup, zero cards, unsupported browser APIs, or a reduced-motion preference fail safely. Reduced motion changes programmatic scrolling from smooth to instant without changing layout or content.
|
||||
- Controls carry the native `hidden` attribute in server output. Each controller removes it only after its track, cards, buttons, media query, and scroll APIs initialize successfully. With JavaScript disabled or controller initialization rejected, controls stay hidden and native scrolling remains available.
|
||||
- If a viewport change turns an adaptive rail into a grid while either navigation button owns focus, the controller first gives the always-visible section heading a temporary `tabindex="-1"`, focuses it with `preventScroll`, removes the temporary attribute, and only then hides the controls and removes the track's region/tab-stop enhancement. If focus is elsewhere, it stays unchanged. Crossing back restores rail semantics and control state.
|
||||
- If a viewport change turns an adaptive rail into a grid while either navigation button owns focus, the controller focuses the first full-card related-story link with `preventScroll` before hiding the controls and removing the track's region/tab-stop enhancement. The link is naturally focusable and remains visible in the grid in Chromium, Firefox, and WebKit, so focus never depends on a temporary heading `tabindex`. If focus is elsewhere, it stays unchanged. Crossing back restores rail semantics and control state.
|
||||
|
||||
## Accessibility
|
||||
|
||||
@@ -131,7 +131,7 @@ Test-driven implementation begins with failing tests for:
|
||||
- Playwright coverage at 375, 768, 900, 901, 1440, and 2560 pixels in light and dark themes.
|
||||
- The complete browser `3/5 × adaptive/grid/carousel` matrix, plus isolated PHPUnit factory coverage for availability counts of one, two, and four; browser fixtures never mutate unowned posts to manufacture partial results.
|
||||
- Runtime geometry: exact grid column counts; carousel card width formula within two CSS pixels; 24px-to-25% continuation preview bounds; correct control visibility at 900/901; track-only overflow; and `document.documentElement.scrollWidth <= document.documentElement.clientWidth`.
|
||||
- Resize focus regression in both directions, including 900→901 while Previous owns focus and while Next owns focus; the visible section heading becomes the destination before controls hide.
|
||||
- Resize focus regression in both directions, including 900→901 while Previous owns focus and while Next owns focus; the first related-story link becomes the cross-browser destination before controls hide.
|
||||
- Real pointer/button and keyboard interaction without a focus trap.
|
||||
- No-JS access to every related story.
|
||||
- Clicking a seeded related story returns HTTP 200 rather than 404.
|
||||
|
||||
Reference in new issue
Block a user