Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to drag on Firefox's responsive design mode (r is undefined) #8877

Closed
rayhanw opened this issue Oct 16, 2019 · 4 comments
Closed

Unable to drag on Firefox's responsive design mode (r is undefined) #8877

rayhanw opened this issue Oct 16, 2019 · 4 comments

Comments

@rayhanw
Copy link

rayhanw commented Oct 16, 2019

mapbox-gl-js version:1.4.1 (also had the same issue on 1.4.0)

browser: Firefox Quantum (69.0.3)

Steps to Trigger Behavior

  1. Switch to firefox responsive design mode
  2. Choose a phone preset (Only does not work on any phone preset, works fine if on responsive preset)
    List of broken phone presets:
  • Galaxy S9/S9+
  • iPad
  • iPhone 6/7/8
  • iPhone 6/7/8 Plus
  • iPhone X/XS
  • Kindle Fire HDX
  • Galaxy Note 9

Link to Demonstration

https://codepen.io/rayhanw/pen/poobNrY
EDIT: No longer need mapbox api key, as i made an alternate public one for the purpose of demonstrating this error

Expected Behavior

Content of map gets dragged around

Actual Behavior

  • Getting an r is undefined error when trying to drag the map
  • Map does not get dragged
    mapbox
@arindam1993
Copy link
Contributor

This looks like a bug with firefox's touch event simulator, its sending and invalid TouchEvent instance that does not have the touches array.

@kkaefer
Copy link
Contributor

kkaefer commented Oct 23, 2019

I confirmed with a physical iOS devices that it does indeed get touches. In addition, Firefox seems to add a touch to the TouchList object at some point after calling DOM.mousePos: When using console.log, the TouchList objects show up as empty, but when expanding them, the actually do contain the touch.

https://bugzilla.mozilla.org/show_bug.cgi?id=1588438 looks like it might be related.

@kkaefer
Copy link
Contributor

kkaefer commented Oct 23, 2019

I can also reproduce https://bugzilla.mozilla.org/show_bug.cgi?id=1549220: when adding a console.log(e) before acessing e.touches[0], the TouchList is correctly populated and the error goes away.

@kkaefer
Copy link
Contributor

kkaefer commented Oct 23, 2019

I don't think we should add a workaround for this, given that the Responsive Design Mode is a developer tool and end users are unlikely to encounter this.

@kkaefer kkaefer closed this as completed Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants