Menu

#17 Strange behaviour in textarea

open
None
4
2006-04-21
2006-04-21
No

Not sure if you guys are supporting text "area" fields
(as opposed to plain old text fields), but since gmail
uses textarea(s) then I guess you will be (?).

Anyway, things start to get a bit strange when you have
lots of data in a textarea.

I have a textarea with CSS formatting to change the
font, height and width (so.. height in fixed 50 px,
width 100% and font-family:tahoma.)

If I type a carriage return, then start typing the a
name ready for auto complete, one of two unexpected
things happens:

1. The item selected from the auto-complete list
"replaces" the prvious item in the textarea (as opposed
to appending as it usually does).

2. If the text area is full, and there is text below a
scroll-line, the character typed by the user to bring
up the auto-complete list remains after a selection is
made.

For example:

Imagine you have "Batman" in your list. When the user
types "b", Batman appears in the auto-complete list.
Selecting this item should replace the "b" typed by the
user, however if the "b" is out of view when typed, the
you end up with "bBatman".

I am using firefox 1.5.0.2 on WinXP Pro.

Discussion

  • - 2006-04-21
    • priority: 5 --> 4
    • assigned_to: nobody --> valmont
     
  • - 2006-04-21

    Logged In: YES
    user_id=850577

    I just had a bit of a hack around to see if I could fix
    this, and have made a change which appears to work, but as
    usual I'm not sure of the implications:

    ------------------------------------------------

    function getUserInputBase() {
    s = siw.inputBox.value;
    a = s;
    if ((lastComma = s.lastIndexOf(",")) != -1) {
    a = a.substring(0, lastComma+1);
    //a = a.replace(/^(.*\,[ \r\n\t\f\s]*).*$/i,'$1');
    }
    else
    a = "";
    return a;
    }//getUserInputBase()

    ------------------------------------------------

    I'm really not sure what the purpose of the regular
    expression was, but it seems that this function need only
    return the "base" value for the user input. Of course the
    reference to "," explicitly means that a ";" will not be
    recognised, but I believe this problem exists elsewhere too(?)

    I'd like to know how the "substring" version I have posted
    here may affect things. Anyone?

     

Log in to post a comment.