Pasting multi-line text into single-line text widget

RESOLVED WONTFIX

Status

()

Core
Layout: Form Controls
--
minor
RESOLVED WONTFIX
17 years ago
16 years ago

People

(Reporter: Anti Veeranna, Assigned: Akkana Peck)

Tracking

(Blocks: 1 bug)

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

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 

111
222
333

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

Results:
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.
(Reporter)

Comment 1

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

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.
(Reporter)

Comment 4

17 years ago
According to:
http://www.w3.org/TR/html401/interact/forms.html#input-control-types
<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 http://home.netscape.com
2. copy paste the following in the search textbox:
401k
netscape
aol
3. click on search

actual:
able to copy paste all the lines in the textbox

note:
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.

Status: UNCONFIRMED → NEW
Ever confirmed: true
(Reporter)

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

to:

  Pasting multi-line text into single-line text widget

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

Updated

17 years ago
Blocks: 108120
(Assignee)

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?
(Reporter)

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
Status: ASSIGNED → NEW
Priority: P3 → --
Target Milestone: mozilla0.9.7 → ---
(Assignee)

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.
Status: NEW → RESOLVED
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.