menu : prevent navigation flash when clicking current page closes #61
All checks were successful
Deploy / Deploy to Production (push) Successful in 5m25s
All checks were successful
Deploy / Deploy to Production (push) Successful in 5m25s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
012aada73b
commit
618c8d79c4
1 changed files with 6 additions and 3 deletions
|
|
@ -24,9 +24,12 @@
|
|||
}
|
||||
})
|
||||
|
||||
function handleNavClick() {
|
||||
function handleNavClick(e, slide) {
|
||||
if (slide.id === activeId) {
|
||||
e.preventDefault()
|
||||
return
|
||||
}
|
||||
navigation.closeMenu()
|
||||
// La navigation elle-même est gérée par le router via le <a href>
|
||||
}
|
||||
|
||||
function getTitle(slide) {
|
||||
|
|
@ -56,7 +59,7 @@
|
|||
<li class="menu-nav-item">
|
||||
<a
|
||||
href={slide.path}
|
||||
onclick={handleNavClick}
|
||||
onclick={(e) => handleNavClick(e, slide)}
|
||||
class="menu-nav-link"
|
||||
class:active={activeId === slide.id}
|
||||
aria-current={activeId === slide.id ? 'page' : undefined}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue