P much nodding along with all of that: it depends being the key for sure. I’m still a fan of a button for a modal if I can, but “extending” a link isn’t the worst thing if needs be. I’m the same as you: bother Heydon with it
October 27th, 2020
I’d be interested in getting your take on the logic I’m using here: https://adactio.com/journal/17546
…generally you can’t go wrong with a button. … That said, I think that links can also make sense in certain situations.
What I’ve started doing with stuff like accordions is rendering a headed group of content and passing that into something like a vue component or web component that then sucks all the content out and turns it into the interactive stuff. A thing called progressive enhancement?
I did exactly this recently on a project! Used hash links to control a modal and then enhanced with a WC. Button would be better tbh but to do that and keep the fallback you’d need to use role or have the WC swap out the link for a button (yuck).