Closed Bug 1192656 Opened 9 years ago Closed 9 years ago

Random newlines entered in Google Sheets cells when pressing enter

Categories

(Web Compatibility :: Site Reports, defect)

Firefox 39
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bugzilla4, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
Build ID: 20150806001005

Steps to reproduce:

Entering data into a Cell in any Google Sheets spreadsheet from the keyboard, and pressing enter or otherwise leaving the cell.


Actual results:

About 1/4 of the time, an extra newline <CR><LF> is entered into the cell when the user presses Enter or otherwise leaves the cell. This causes the cell to be 2 lines high. Editing the cell, using F2 or Enter, and then pressing Backspace once, causes the linefeed AND THE LAST CHARACTER to be deleted.


Expected results:

Pressing <Enter> in a cell should just move to the next cell. A line break should not be put in the cell unless the user presses <Alt>+<Enter>.

The bug has been reported and discussed on the Google Product Forums here:

https://productforums.google.com/forum/#!msg/docs/KlBdLukjw5s/-PTEPAfaKzIJ

Problem has been documented in several platforms of Firefox 39 and Seamonkey 2.33.1
Problem appeared sometime in the February to April 2015 time frame.
As annoying this problem is, I suspect the fix has to come from Google...

As far as I remember it was a change on the spreadsheets side, not a particular release of Firefox introducing this behavior.
Flags: needinfo?(bugzilla4)
I have a similar problem. Entering data into a cell will randomly add an additional line regardless of whether enter, tab or a click is used to move to another cell. This may be a Google problem, but it only occurs in Firefox. It would be nice if either Google or Mozilla would help solve this problem. It has been around for a while.
Nickolay, I agree that it was probably introduced by a Google update, though I can't prove that. 

It has been posted on the Google side for quite a while, and in that discussion, as Dave says, it seems to only occur on Firefox & SeaMonkey.
Flags: needinfo?(bugzilla4)
Component: Untriaged → Desktop
Product: Firefox → Tech Evangelism
Version: 39 Branch → Firefox 39
Hallvord, can you take a look here?
Assignee: nobody → hsteen
Flags: needinfo?(hsteen)
I think I've seen this sporadically, but now I can't reproduce on demand.. In fact, it seems I have the opposite problem: cells that have line breaks in them are copied without.. :-/
Flags: needinfo?(hsteen)
I can reproduce this sporadically but regularly on sheets and it's really annoying. I don't have a lot of time to dedicate, but if there any logs or debugging tips I can run quickly I'd be willing to help.

Alternately, Google is often pretty responsive if we have the right contacts.
If Docs is run anything like GMail, Google tends to have different "versions" in production simultaneously so it's semi-random which one you get (on GMail it depends on browser sniffing but AFAIK it can also be part of a gradual roll-out where some users get an "old" and some a "new" version). I'm not aware of any trick to find a version identifier in G Docs, might not be possible? But it would be nice to know if this is about specific version(s).

Also, when this happens - if you copy the contents of the cell to Notepad, does it include the newline?
Flags: needinfo?(bugzilla4)
@hallvors:
I haven't found any way to determine the version of Google Sheets that's running, but it's been consistently a problem since about March 2015. 

YES, when you copy the cell to a text editor that shows control characters, it DOES include <cr><lf>, (at least on Windows). 

Please make sure you've reviewed the Google Product Forum discussion on this bug for input from many other affected users.
https://productforums.google.com/forum/#!msg/docs/KlBdLukjw5s/-PTEPAfaKzIJ

It is possible that this is only occurring with sheets that were CREATED under an older version and upgraded to the current version of Gooble Sheets. I can't seem to reproduce it in a new sheet.
Flags: needinfo?(bugzilla4)
(In reply to Jim Booth from comment #9)
> It is possible that this is only occurring with sheets that were CREATED
> under an older version and upgraded to the current version of Gooble Sheets.
> I can't seem to reproduce it in a new sheet.

I agree with the around-March start for the problem.  It happens to me on all newly-created sheets.

I'm running 43.0a1 nightly on Linux.
I did quite some G spreadsheets work last night, and I saw this problem sporadically. My hunch right now is that it happens if G Spreadsheets temporarily runs into an unexpected condition like a network hiccup while you're editing..? Sometimes I saw "You're now offline" followed by "..and we're back" messages flash by in the top-of-screen status message area when it happened. Perhaps they add a BR tag to the element you're editing by default (to ensure it's tall enough for the cursor?) and some code paths that make the cell loose focus don't bother removing that BR?? Nothing I can prove right now but worth checking..
After some more testing I think it's got something to do with their autocomplete feature. It feels like pressing enter just before they create the pre-highlighted autocomplete selection will add the linebreak as part of the value. Sometimes the linebreak even ends up in front of the value (!?)

Perhaps some interesting code here?
https://docs.google.com/static/spreadsheets2/client/js/1884029591-ritz_waffle_i18n_inputtools.js
"Google is aware of this issue and working on a solution"
https://productforums.google.com/d/msg/docs/KlBdLukjw5s/9WJj6lDIB_EJ

\o/

It's also reportedly happening in Chrome sporadically according to a user in the thread. I still think there's some subtle issue with the autocomplete. Sometimes it seems to fail to autocomplete, and that seems to be causing the problem somehow..
I think I've found a reliable way to reproduce: enter a cell (for example with [F2]), type something, *delete everything you typed*, type something else, leave cell. The deletion triggers the problem.
I can confirm that the steps in comment 14 trigger this bug every time.  This is triggered when leaving the cell with any method: Tab, Enter, or mouse click.
FWIW, I have autocomplete turned off, too.
Assignee: hsteen → nobody
Have not seen this problem recently. It appears to have been fixed by Google. Is anyone else seeing the problem?

Mark WFM?
I could still reproduce with one single spreadsheet I tested but not in others (?!). Closing as fixed, since we contributed to the discussion and thus in a way reached out to Google (Tech Evangelism bugs are closed as "Fixed" if we reached out and believe we contributed to a fix, as "Worksforme" otherwise).
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Web Compatibility

Good day!
I could still reproduce this bug with any Google spreadsheet, but not in the MS or Collabora. I can't reproduce it in MS Edge or Chrome.
Regards, Ivan.

Sorry, forgot to add the way to reproduce:

  • choose cell;
  • type anything;
  • delete it by any way (backspace, delete or Ctrl+X...);
  • go away from cell (Enter, Tab, arrows, click on another cell...).

Cell will look like empty but with extra line feed symbol (two lines height). Pressing Delete on this cell makes it empty and one line height. Choosing the cell, pressing F2, then Backspace and exiting do the same.

See Also: → 1605018

Hello. Why is this bug closed when it's pretty clearly still present and it's pretty clearly a bug in Firefox? If you want a non-Google example code where the bug is really obvious, see the following snippet.


The test code:

<!DOCTYPE html>
<html>
<head>
</head>
<body>
    <div id="div" style="background-color: lightgrey" contenteditable="true">xxx</div>
    <button onclick="document.getElementById('span').innerHTML = document.getElementById('div').innerHTML">copy</button>
    <div>***<span style="background-color: lightgrey" id="span"></span>***</div>
</body>
</html>

Steps to reproduce:

  1. Click copy.

  2. Check that there's no characters between *** sequences.

  3. Delete xxx from the contenteditable div.

  4. Click copy again.

Expected result: ****** with no line break.

Actual result: ***, a line break, ***.

  1. Type xxx again.

  2. Click copy.

Expected Result: ***xxx*** with no line breaks.

Actual Result: ***xxx, a line break, ***.

Flags: needinfo?(miket)

This was closed 3 years ago. Please file a new bug.

Flags: needinfo?(miket)

(In reply to Mike Taylor [:miketaylr] from comment #22)

This was closed 3 years ago. Please file a new bug.

Thank you! I followed your instruction and here it is with an updated test case and additional notes:

https://bugzilla.mozilla.org/show_bug.cgi?id=1615852

Thanks!

You need to log in before you can comment on or make changes to this bug.