eureka2 / ab-datepicker

An accessible and bootstrap compatible datepicker
MIT License
63 stars 55 forks source link

Calendar Icon <a> should be a <button> for accessibility reasons. #47

Open boeltjen opened 5 years ago

boeltjen commented 5 years ago

Hi there,

While you've added most of the workarounds (keyboard interactions and role=button), it would be simpler to just replace the with a

rileymacisaac commented 5 years ago

This isn't so much an accessibility reason as it is "best practice". There isn't really a good reason to use an anchor over a button, especially since you could just preventDefault on click.

@eureka2 would you consider providing functionality for people to choose to use a button over an anchor? For example, providing an option (boolean) named useButtonForTrigger.

jcputney commented 4 years ago

This would also be really helpful in browser/OS combinations that don't allow tabbing to anchors by default (like Firefox on Mac), but do allow tabbing to buttons.