leptos-rs / leptos

Build fast web applications with Rust.
https://leptos.dev
MIT License
16.29k stars 648 forks source link

`A` components aria-current attribute not getting set in nested routes #3196

Open TERRORW0LF opened 2 days ago

TERRORW0LF commented 2 days ago

Describe the bug When placing links with the A component inside a nested route the aria-current attribute does not get set on client side navigation.

Leptos Dependencies

leptos = { version = "0.7.0-rc1", features = ["nightly"] }
leptos_axum = { version = "0.7.0-rc1", optional = true }
leptos_meta = { version = "0.7.0-rc1" }
leptos_router = { version = "0.7.0-rc1", features = ["nightly"] }

To Reproduce Steps to reproduce the behavior:

  1. Set up the router example in an start-axum-0.7 template (remove tracing and futures)
  2. Remove routing progress (causes bugs which alter this one)
  3. Run cargo leptos watch
  4. Open the site and navigate to a contact
  5. Open the browser's inspector and select the contact's a tag
  6. The aria-current="page" attribute is not there

Expected behavior The aria-current="page" attribute gets applied to the a tag of the current contact

codewing commented 2 hours ago

FYI: Just came across a variation of this bug in 0.6.15 as well - but for me it sets the current attribute on both A tags