Pasting multi-line text into single-line text widget




Layout: Form Controls
17 years ago
16 years ago


(Reporter: Anti Veeranna, Assigned: Akkana Peck)


(Blocks: 1 bug)


Firefox Tracking Flags

(Not tracked)



(1 attachment)



17 years ago
It is possible to insert multiple lines of text into textboxes.
Steps to reproduce:
1) Create a new text file with your favourite editor
2) Insert the following 3 lines 


3) Copy those 3 lines into the clipboard
4) Click inside the textbox
5) Paste (the contents of the clipboard)

The last line of the text block (333) remains visible, it's possible
to scroll up by using the arrow keys (left and right).

Expected behaviour:
Newlines should be stripped.

Tested on:
Latest nigthly build on Linux (2001061821) available as of writing of this.

Comment 1

17 years ago
Created attachment 39109 [details]
testcase, with comments.

Comment 2

17 years ago
By the way, it also works with the location bar, e.g. it's possible
to paste that textblock (3 lines) into the location bar, and move around
in it with arrow keys.


Comment 3

17 years ago
I'm not sure if this is correct behavior or not.
I'm not sure if we should be stripping the newlines or leaving them in.

Comment 4

17 years ago
According to:
<input type="text"> should create a single-line text input control.

Besides, it's not possible to enter multiline text into that textbox
(not to be confused with textarea), this bug triggers only if the text
is pasted into it.

The sames goes for the location bar, I don't think it is supposed to be
contain multiple lines of text.


Comment 5

17 years ago
See bug 23485 for some discussion about whether pasting into the location bar
and other textboxes should strip spaces.  This is a bug, though.

Comment 6

17 years ago
WFM on Win32 build 2001062009.

Comment 7

17 years ago
I get the same behaviour on linux build 2001071008

Comment 8

17 years ago
I am able to reproduce this bug on linux 20010716.
Not seeing this behaviour in windows or Macintosh. 

1. go to
2. copy paste the following in the search textbox:
3. click on search

able to copy paste all the lines in the textbox

all the search engines use textbox control for their search.. this bug would
affect the user interaction to great extent. 

I believe this is a bug specific to linux.... and should be looked at.

Changing the bug status to NEW.

Ever confirmed: true

Comment 9

17 years ago
confirmed, the bug does not occur on Windows. Only Linux (and perhaps other
Unixes as well?) is affected.

Comment 10

17 years ago
I am still able to reproduce this bug on Linux 7.1 - builID :
2001-10-17-04-0.9.4 (branch build).

Adding keyword mozilla0.9.6

Keywords: mozilla0.9.6

Comment 11

17 years ago
Assignee: rods → kin

Comment 12

17 years ago
So apparently this behavior is intentional on Linux. Cc akkana for 
verification, since I think she handled this.

You can change the behavior by setting a pref in your prefs.js file, located in 
your profile directory. Add the following pref to prefs.js:

  user_pref(editor.singleLine.pasteNewlines, <number>);

Replace <number> with one of the numbers below:

 Paste Intact        --> 0
 Paste First Line    --> 1
 Replace With Spaces --> 2
 Strip Newlines      --> 3

I believe 0 is the default on Linux so that is why you are seeing the behavior 
you describe. 1 seems to be the default on all other platforms. Akkana, should 
we make Linux/Unix consistent with the other platforms?

Changing summary from:

  Multiple lines of text in textboxes


  Pasting multi-line text into single-line text widget

so that it's a little clearer what the bug is about.
Priority: -- → P3
Summary: Multiple lines of text in textboxes → Pasting multi-line text into single-line text widget
Target Milestone: --- → mozilla0.9.7


17 years ago
Blocks: 108120

Comment 13

17 years ago
Kin's summary is correct -- the behavior is intentional, because text fields in
many other linux toolkits allow pasting of multiple lines, and it's useful in a
number of cases.  For instance, because of this behavior, on Linux you can copy
a url spanning multiple lines (like one which has been broken by a mailer like
Eudora) and paste it into the urlbar or content area, and the url will work,
whereas on other platforms the broken url will be truncated to the first line --
at least, I think that's the default behavior, but someone seems to have removed
the default value from all.js. :-(

Comment 14

17 years ago
So akkana, what should we do with this bug? Close it as INVALID?

Comment 15

17 years ago
I agree with Akkanas comment in that this kind of behaviour can indeed be
useful, however, after pasting such an url into a widget there is no indication
whatsoever that there are multiple lines of text in that widget, and that can be
confusing to new users. Option 3 (strip newlines) would be much better, but then
again, that is my opinion.

Comment 16

17 years ago
Letting akkana decide what to do. :-)
Assignee: kin → akkana
Priority: P3 → --
Target Milestone: mozilla0.9.7 → ---

Comment 17

17 years ago
The behavior is intentional and was discussed to death before it was
implemented.  People who don't like it can always change the pref.
Last Resolved: 17 years ago
Resolution: --- → WONTFIX

Comment 18

16 years ago
*** Bug 181269 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.