Many of users send to me bug report with the next case:

1) copy some text
2) past some text to comment box

Expected Results: User can send comment.
Actual Results: form action disabled.

Comments

snig created an issue. See original summary.

icecreamyou’s picture

Component: Code (Features) » User interface
Category: Feature request » Bug report
Status: Needs review » Needs work

Ooh, good catch. You're quite right that this is a bug - and actually it's not just a bug in the comments, it's also a bug in the main status form. The issue is that we're trying to count characters in a textfield and they can change on any of the following events:

- keydown
- keyup
- paste
- cut
- drop

Do you mind submitting an updated patch that fixes this in both places? Thanks for your help!

snig’s picture

StatusFileSize
new1.4 KB

@IceCreamYou, thanks for reply.

I can't reproduce this on the main form, can you provide steps to reproduce? btw, on the main form I saw that we can submit empty form, so I think that we can add some checks:

  if (fbss_remaining == Drupal.settings.statuses.maxlength) {
    jQuery('.statuses-submit').attr('disabled', true);
    statuses_submit_disabled = true;
  }
snig’s picture

Status: Needs work » Needs review

let's change status of issue to nr, maybe anybody can help to test it.

icecreamyou’s picture

I can't reproduce this on the main form, can you provide steps to reproduce?

Try doing any of the following:

  • Highlight text on the page, then drag-and-drop it into the status textarea
  • Use your browser's Edit > Paste menu to paste text into the status textarea
  • Use your browser's Edit > Cut menu to cut text from the status textarea

In each of these cases, the character counter won't update.

(As an aside, I recently learned there is actually another minor character counting issue, which is that the counter counts each unicode code point, so characters in the unicode astral planes or characters with combining marks or grapheme clusters will all be counted as multiple characters. I think I'm okay with that though.)

on the main form I saw that we can submit empty form, so I think that we can add some checks

This was intentional; the form submits but it doesn't do anything. The reason for this is that other modules like FBSMP can attach fields to the status update form, so it might make sense to submit the form with no status if another field is filled out.

icecreamyou’s picture

Status: Needs review » Needs work