Discussion
Loading...

Post

  • Log in
  • Sign up
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Jonathan Schofield
Jonathan Schofield
@urlyman@mastodon.social  ·  activity timestamp 7 months ago

On revisiting a codebase where I used

`href=" #main"`

instead of

`aria-current="true"`

…some thoughts.

I accept the user agent benefits of the latter but clicking the latter generates a page request (wasteful), whereas clicking the former does not (good).

Would it be bad to combine both?

#a11y

#main #a11y
  • Copy link
  • Flag this post
  • Block
James Edwards
James Edwards
@siblingpastry@mastodon.world  ·  activity timestamp 7 months ago

@urlyman Is it wasteful? It wouldn't generate a remote request, so why does it matter?

You could intercept the click, supress its native action, then route it manually with location.hash and auto-scroll or something, then focusing the target. Seems a bit overkill though.

However that's probably not the right token for `aria-current` anyway -- how are you using it, what's the context of that link? This might answer both questions.

  • Copy link
  • Flag this comment
  • Block
Instance logo
bonfire.cafe
Log in Create account
Banner for bonfire.cafe

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire bovenjan · 1.0.3-alpha.10 no JS en
Federation disabled
Instance logo
  • Explore
  • About
  • Members
  • Code of Conduct

Install bonfire.cafe

Get the full app experience

1 Tap Share 2 Add to Home Screen