Fix: navigation sous-pages blog/white-papers + singleSlug
All checks were successful
Deploy / Deploy to Production (push) Successful in 25s
All checks were successful
Deploy / Deploy to Production (push) Successful in 25s
- App.svelte : flèches clavier bloquées sur sous-page (ArrowLeft → history.back()) - Blog/WhitePapers : reset de articleData/itemData après 1100ms (post-transition) pour éviter le flash pendant l'animation de changement de slide - WhitePapers : singleSlug jamais resetté (pré-affiché à l'arrivée sur la slide) - WhitePapers : $effect sur isActive pour replaceState + openItem si itemData null - WhitePapers/Blog : handlePopState ignore les popstate hors de la page courante Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9f8854efa5
commit
fcca068868
3 changed files with 38 additions and 4 deletions
|
|
@ -58,10 +58,22 @@
|
|||
window.addEventListener('resize', handleResize)
|
||||
|
||||
const handleKeydown = (e) => {
|
||||
if (e.key !== 'ArrowRight' && e.key !== 'ArrowLeft') return
|
||||
|
||||
// Si on est sur une sous-page (ex: /livres-blancs/slug), ne pas changer de slide
|
||||
const activePath = slides.active?.path ?? ''
|
||||
const currentPath = window.location.pathname.replace(/^\/en/, '') || '/'
|
||||
const isSubPage = activePath && currentPath.startsWith(activePath + '/')
|
||||
|
||||
if (isSubPage) {
|
||||
if (e.key === 'ArrowLeft') history.back()
|
||||
return
|
||||
}
|
||||
|
||||
if (e.key === 'ArrowRight') {
|
||||
const next = slides.all[slides.activeIndex + 1]
|
||||
if (next) slideTo(next.path)
|
||||
} else if (e.key === 'ArrowLeft') {
|
||||
} else {
|
||||
const prev = slides.all[slides.activeIndex - 1]
|
||||
if (prev) slideTo(prev.path)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue