Closed Bug 352348 Opened 18 years ago Closed 18 years ago

pasting text with newlines in the search textbox is confusing

Categories

(Firefox :: Search, defect)

x86
All
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 321000

People

(Reporter: bogdanb, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1b1) Gecko/20060601 BonEcho/2.0b1 (Ubuntu-edgy)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1b1) Gecko/20060601 BonEcho/2.0b1 (Ubuntu-edgy)

When text that contains newlines is pasted in the search bar, the contents are confusing: First of all, only the last line is shown. Moving the cursor with the arrows can reach the other lines (but only one is visible at one time).

If the user does press Enter, the query is executed correctly (at least by Google; presumably it's the search engine who removes the newline).

This happens for all one-line text boxes I have encountered in Firefox, including the address bar (often I need to paste addresses broken by a mail client) and the "search" and the "find" boxes.

I think for all of Firefox's one-line boxes we should always replace newlines with spaces; if the text-box is one line it means that we never need a newline in the content.

This happens too in one-line boxes in the web pages. I _think_ we should do the same in those cases too, but this one needs a bit more care; in particular, we should be careful not to break boxes that resize themselves automatically, maybe through scripts. We could do a special-case behavior: if (1) a text-box is one line high and (2) no scrollbar can appear (as in the Google search box), then newlines in the box don't break the line (preferably display some special character, or display them as spaces); however, the content string should remain unchanged so as not to break whatever strange thing the page _may_ do with such entries, unless the user deletes the newline (which is why the special character is useful).

Interestingly, the tool-tips (for example the search suggestions) are one-lined on my computer; in my case the newline is turned to one of those 000A-in-a-box characters, but I'm not sure if that's not a side-effect from some strange font choice.

Reproducible: Always

Steps to Reproduce:
1. Copy a few words with a newline between them. For example, imagine you received this news post and you want to Google for "deep-fried Coca-Cola":

...the Texas State Fair were enjoying deep-fried
Coca-Cola. English scientists were conducting experiments...

2. Paste the text in the search box.

Actual Results:  
The text box displays "Coca-Cola". To see the rest of the pasted text, you need to press "home" _and_ "left-arrow". Not even "up-arrow" works.

Expected Results:  
The text box should read "deep-fried Coca-Cola".

I think it's on all Firefox versions I've ever used.
Obviously, in the steps to reproduce, I meant to paste the text after copying from the example :)

*** This bug has been marked as a duplicate of 321000 ***
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.