Bug 56442 - Horizontal scrollbar often appears when typing in textarea when the text should be wrapped instead.
Summary: Horizontal scrollbar often appears when typing in textarea when the text shou...
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-15 19:15 PDT by Cngevpxhaqrefpber
Modified: 2022-12-16 03:31 PST (History)
5 users (show)

See Also:


Attachments
Demo HTML page (96 bytes, text/html)
2011-03-15 19:16 PDT, Cngevpxhaqrefpber
no flags Details
Screenshot of what the issue looks like on my system (5.02 KB, image/png)
2011-03-15 19:17 PDT, Cngevpxhaqrefpber
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cngevpxhaqrefpber 2011-03-15 19:15:43 PDT
Ever since I switched to Chrome (10) and Safari (5.0.4) I've noticed that often, when I'm typing in a textarea, a horizontal scrollbar appears when the text I'm typing should be wrapped to the next line instead. When this happens, it's not until I type another letter that the scrollbar disappears and the text wraps as it should.

I think the best way to explain this is with an example. (It took a bit of time for me to figure out how to reliably reproduce this by the way.) I should note that the problem happens on many different websites with textareas of varying widths and different text inside the textarea.

If you:

1. Open up the example HTML page attached (which is just a simple textarea with a width of 630 pixels, and a height large enough to contain at least two lines of text)

2. Type (or copy and paste) the following bit of text twice so that each is on a separate line: was in the 90s doesn't mean there's no room for a new promotion either or that

3. Press space

... then a horizontal scrollbar will appear. I've also attached a screenshot showing what it looks like after I press space on my system. The font shown is Courier New, size 12, and I'm using Windows 7. If you use a different font/size you'll probably have to play with the textarea width and maybe even the actual text inside too.

Two things I noticed:

1) If you only copy and paste or type that line once and then press space, the problem doesn't seem to occur.

2) If you type several lines of gibberish, and then copy+paste or type that line once on its own line, the problem does occur.

One final thing: this may be related to bug #55970, I'm not sure.
Comment 1 Cngevpxhaqrefpber 2011-03-15 19:16:45 PDT
Created attachment 85897 [details]
Demo HTML page
Comment 2 Cngevpxhaqrefpber 2011-03-15 19:17:48 PDT
Created attachment 85898 [details]
Screenshot of what the issue looks like on my system
Comment 3 Cngevpxhaqrefpber 2011-03-15 19:41:49 PDT
Sorry, that's Courier New size 10, not 12. Default on Win7 I'm pretty sure.

I have experienced the issue on sites like reddit, though, where the textarea font is different (Verdana?).
Comment 4 Cngevpxhaqrefpber 2012-01-03 15:41:57 PST
Bug still exists in Chrome 16.
Comment 5 katna.bhargavi 2014-03-05 23:58:19 PST
I have started analysing this issue.

This is happening due to trailing spaces at the end of the lineBreaker.
In BreakingContextInlineHeaders.h , handleText() API  a check is added
  if (!m_width.fitsOnLineIncludingExtraWidth(charWidth)) . In this just setting the position of lineBreaker and renderer will do. Trailing whitespaces needs to be removed to set the space at the end of line in text area.
Comment 6 Ahmad Saleem 2022-12-16 03:30:58 PST
I am not able to reproduce this bug in Safari 16.2 and Safari Technology Preview 160 and does not get any horizontal scrollbar. Appreciate if someone else can confirm and then we can mark this as "RESOLVED CONFIGURATION CHANGED" or "RESOLVED WONTFIX". Thanks!