-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change link_to_remove_association to a button #402
Comments
So the question is how to style the link as a button (I added an answer to the SO question you linked to), right? You can just style the link using the button-classes, as follows:
Or do you need another reason why the link has to be a html button? |
My issue is with the behaviour and accessibility. It can be styled in any way, that's easy, but users expect a button to behave like a button and not like a link. (You can open a link in a new tab, it has a context menu and keyboard interactions are different between butrons and links) So the element should be a |
Here's a pretty great in depth article about the issue. https://marcysutton.com/links-vs-buttons-in-modern-web-applications/ |
Ok, the SO question confused me ;) I understand the purist approach to the HTML. I guess I am showing my age in preferring links because they used to be much easier to style. At the moment it is not possible to generate a button, I/we/someone should add the |
I do remember the times, but yeah, I was always a purist. :) I'll see if my project mates and me could dig through the code enough to make a pull request. |
I actually have a real use case now. We're doing a billing form that needs to be disabled before the user has done some authentication stuff. So the form is inside a fieldset that has a disabled attribute. That automatically makes all form elements inside disabled (including buttons), but links work as usual, so the add/remove row links still work, but they should be disabled. |
Haha yes, good use case indeed. Maybe a bit contrived and imho also easy to work-around (which are probably already doing). Anyway, you got me inspired to look a little further. I imagined I would be easy to just replace But just using |
I've created a pull request for this. Changed the text links to buttons and updated the specs. |
The annoying thing about the |
Any update on this ? |
Hi! I'd very much like to have a button in place of a link for the remove association action. The link-as-button doesn't link anywhere and it does an action. It should probably be a button by default, or at least possible to make into a button.
I did find a stack overflow question about it, but nesting a button inside a link is pretty wonky.
Is this possible, or could you make it possible? Thanks!
The text was updated successfully, but these errors were encountered: