Use attr to set disabled attribute for a tag, instead of using prop#328
Use attr to set disabled attribute for a tag, instead of using prop#328pzgz wants to merge 1 commit intorails:masterfrom
a tag, instead of using prop#328Conversation
Since anchor tag `a` doesn't actually support `disabled` attribute. So, if we use `prop` to disable a link, the css selector `a[disabled]` won't work. In some css frameworks, such as bootstrap, the anchor won't have any differences. Using attr() will make things different.
|
For this change, it's mainly because, we used both link anchors and buttons in a form to do things, and we would like to block the buttons during the server processing. Currently, the buttons with
So the simple idea is, for link anchors, we can still use `.attr('disabled', true) to disable the link anchor, the css selectors will work too. I understood there are some other things might need to be considered, such as, if we click on the link anchors, only the link clicked will be blocked, the buttons in same form will stay original. Not like if we click on the buttons. I am still thinking what's the best approach to links and buttons in a form, but at least we can have a start. Any suggestions? |
|
+1 ran into this same issue I'm pretty sure this is affecting a lot of people. Anyone doing rails + bootstrap is going to see this issue with data-disable-with. |
|
👍 the same issue. |
|
Interesting. Pretty simple fix. Can anyone come up with a test case for this? If not, we can, it'll just take longer to pull this in. |
|
Any updates on this issue? Ran into this recently in a RoR + BS3 project. |
Since anchor tag
adoesn't actually supportdisabledattribute. So,if we use
propto disable a link, the css selectora[disabled]won't work. In some css frameworks, such as bootstrap, the anchor won't
have any differences. Using
attr()will make things different.