Closed Bug 86609 Opened 24 years ago Closed 24 years ago

Pasting multi-line text into single-line text widget

Categories

(Core :: Layout: Form Controls, defect)

x86
Linux
defect
Not set
minor

Tracking

()

RESOLVED WONTFIX

People

(Reporter: duke, Assigned: akkzilla)

References

Details

Attachments

(1 file)

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.
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.
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.
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.
See bug 23485 for some discussion about whether pasting into the location bar and other textboxes should strip spaces. This is a bug, though.
WFM on Win32 build 2001062009.
I get the same behaviour on linux build 2001071008
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
confirmed, the bug does not occur on Windows. Only Linux (and perhaps other Unixes as well?) is affected.
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
->>
Assignee: rods → kin
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
Blocks: 108120
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. :-(
So akkana, what should we do with this bug? Close it as INVALID?
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.
Letting akkana decide what to do. :-)
Assignee: kin → akkana
Status: ASSIGNED → NEW
Priority: P3 → --
Target Milestone: mozilla0.9.7 → ---
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
Closed: 24 years ago
Resolution: --- → WONTFIX
*** 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.

Attachment

General

Creator:
Created:
Updated:
Size: