10

When I try to write a comment in quick succession after another, I get the expected "you gotta wait 15 seconds" notification in orange.

That's fine; I can wait. Ish.

But the "Add Comment" button is also disabled, and it cannot be re-enabled; I have to copy my comment to the clipboard, refresh the entire page, then try again.

Annoying.

(This appears to be new since at most a couple of days ago.)

(Firefox 8.0.1, Windows 7)

2
  • 1
    Ok, I'm seeing it now too. The button is disabled but you can still submit your comment by pressing enter. On FF 8.0 on Win7x64. Commented Jan 4, 2012 at 1:37
  • @balpha: Ta duck :) Commented Jan 5, 2012 at 21:36

1 Answer 1

8

This is another .attr() versus .prop() issue from the jQuery 1.7 upgrade.

The function used by StackExchange.helpers.enableSubmitButton() needs to be updated to toggle the disabled property, instead of setting the attribute:

$(i).find('input[type="submit"]').prop('disabled', h);

or (since there's probably never more than one submit button anyway):

$(i).find('input[type="submit"]')[0].disabled = h;
4
  • 3
    I'm beginning to see why jQuery wanted to start being explicit about the differences between attributes and properties. Unfortunately, "consistency" is not a word that comes to mind when looking through the implementations of prop and attr. In jQuery 1.5, .attr("disabled", "") comes down to elem.disabled = "", which does the right thing. In 1.7, anything that's not === false is considered true. That's what we get for being good citizens previously and using "" instead of false :(
    – balpha StaffMod
    Commented Jan 4, 2012 at 10:34
  • 1
    Yeah, they unfortunately opened a rather large can of worms by originally conflating the two. Despite the upgrade-related problems its caused, I am at least happy that the 1.7 behaviour is now what's expected for modifying the attribute.
    – Tim Stone
    Commented Jan 4, 2012 at 10:50
  • Almost :) Had we used false in the first place, it would still be wrong, but work.
    – balpha StaffMod
    Commented Jan 4, 2012 at 10:58
  • Well, I was willing to consider .attr('disabled', false) the same as .removeAttribute('disabled') :P
    – Tim Stone
    Commented Jan 4, 2012 at 11:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .