Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Jonathan Schofield
@urlyman@mastodon.social  ·  activity timestamp last week

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

  • Copy link
  • Flag this post
  • Block
James Edwards
@siblingpastry@mastodon.world replied  ·  activity timestamp last week

@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
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.3.13 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login