Closed Bug 1261709 Opened 8 years ago Closed 6 years ago

Google Docs forms editor misplaces menu if touch is enabled

Categories

(Web Compatibility :: Site Reports, defect, P1)

defect

Tracking

(platform-rel +)

RESOLVED FIXED
Tracking Status
platform-rel --- +

People

(Reporter: hsteen, Unassigned)

References

()

Details

(Whiteboard: [sitewait] [country-all][platform-rel-Google][platform-relGoogleSuite][platform-rel-GoogleForms])

Attachments

(2 files)

Google docs has fairly recently rolled out a new forms editor. Each form element has an associated drop-down where you can choose the type of element. This menu appears near the top of the document, not where you expect it. This is especially annoying if you scroll down, because when you get far enough you don't see the menu at all unless you scroll up again.
Whiteboard: [needsdiagnosis] [country-all]
Having steps to reproduce the bug would be useful.
I don't know how to use Google Docs. But when I do "Start a new document" I don't see a form editor widget. So I need a kick in the right direction.
On a clean fresh profile.

With Firefox Nightly 48.0a1 (2016-04-03) and layout.css.prefixes.webkit;false
I get the menu at the right place.

with layout.css.prefixes.webkit;true
The menu is still at the right place, even with different window widths.

So I can't reproduce for now. Maybe a step by step would help.
Steps to reproduce (sorry, it was rather late when I noticed this):

1) Log in to Google Drive
2) Choose to create a new form (may have to choose "Create -> More -> Forms" or something like that
3) Add several controls to the form to make the document long enough to scroll down
4) Scroll down and use the menu button indicated in the screenshot to change the type of the bottom-most control.
I tried to reproduce with 45 and 48 a couple times, but wasn't able to make it happen.
This code ends up with a very low negative value for style.top:

    _.k.kY = function (a) {
      var c = this.T().P(),
      d = LX(this).P(),
      e;
      a.style = {
        height: 'auto',
        left: - d.clientLeft + 'px'
      };
      if (1 != this.N.size() || this.Ba('alignbottom').Qb(!1)) e = c.offsetHeight;
       else {
        var f = (0, _.Ta) (DX(this).Mb(), this.N.P()),
        g = GX(this).hb(f),
        f = g.P().offsetTop,
        h = d.clientTop,
        l = _.Sg(c);
        if (this.kx) e = - f - h,
        f = _.jp(c),
        l.body == f ? (h = a.N, f = _.Mj(c).y)  : (h = f.scrollHeight || f.offsetHeight, f = _.Pj(c, f).y),
        d.offsetHeight > h ? e = - f + 1 : 0 > f + e ? e = - f + 1 : f + e + d.offsetHeight > h && (e = h - d.offsetHeight - f);
         else {
          e = _.ah().height;
          var m = _.Mj(c).y,
          n = l.body,
          l = l.documentElement,
          l = m - (new _.Lg(n.scrollLeft || l.scrollLeft, n.scrollTop || l.scrollTop)).y,
          c = c.offsetHeight,
          m = d.scrollHeight,
          g = g.P().offsetHeight,
          d = d.offsetHeight - d.clientHeight,
          q = d - h,
          n = Math.min(0.9 * e, m + d),
          d = Math.min(l, f + h, n - g - q),
          l = Math.min(e - l - c, m + q - f - g, n - g - h);
          d + l + c > n && (e = (n - c) / 2, d < e ? l = n - d - c : l < e ? d = n - l - c : l = d = e);
          e = - d;
          a.style.height = d + l + c + 'px';
          a.style.boxSizing = 'border-box';
          a.style.overflowY = 'auto';
          a.scrollTop = f - d + h
        }
      }
      a.style.top = e + 'px'

One important branching point here is if(this.kx).
Somewhere else in the code, this.kx is set to _.Fca and this again is defined as:

 _.Fca = "ontouchstart" in _.ba || !!(_.ba.document && window.document.documentElement && "ontouchstart" in window.document.documentElement) || !(!_.ba.navigator || !_.ba.navigator.msMaxTouchPoints);

So it fails if touch events are enabled.. (dom.w3c_touch_events.enabled)
Summary: Google Docs forms editor misplaces menu → Google Docs forms editor misplaces menu if touch is enabled
Whiteboard: [needsdiagnosis] [country-all] → [contactready] [country-all]
platform-rel: --- → ?
Whiteboard: [contactready] [country-all] → [contactready] [country-all][platform-rel-Google][platform-relGoogleDocs]
platform-rel: ? → +
Karl, given comment #6, can we talk to Google about this?

(This should possibly affect Chrome as well, but I don't have the right device to test).
Blocks: 1244402
Flags: needinfo?(kdubost)
I can reproduce this in Firefox both on OS X (if I set dom.w3c_touch_events.enabled=1) and a touch-enabled Windows device. I cannot reproduce in Chrome on the same touch-enabled Windows device.
Thanks Kats!
Reported to Google. Switching to sitewait.
Flags: needinfo?(kdubost)
Whiteboard: [contactready] [country-all][platform-rel-Google][platform-relGoogleDocs] → [sitewait] [country-all][platform-rel-Google][platform-relGoogleDocs]
Whiteboard: [sitewait] [country-all][platform-rel-Google][platform-relGoogleDocs] → [sitewait] [country-all][platform-rel-Google][platform-relGoogleDocs][platform-rel-GoogleForms]
This is still an issue.
Whiteboard: [sitewait] [country-all][platform-rel-Google][platform-relGoogleDocs][platform-rel-GoogleForms] → [sitewait] [country-all][platform-rel-Google][platform-relGoogleSuite][platform-rel-GoogleForms]
Rank: 25
Flags: needinfo?(miket)
Priority: -- → P1
This looks fixed, tested on a touch device and a non-touch device to verify.
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(miket)
Resolution: --- → FIXED
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: