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

Fix 3-D config for webgl buffer on iPad Pro & iPad 7th + iOs v13 + Safari #4546

Merged
merged 3 commits into from
Feb 3, 2020

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Feb 3, 2020

Fixes #4502 | Demo

@plotly/plotly_js
cc: @jackparmer

@archmoj archmoj added bug something broken status: reviewable labels Feb 3, 2020
@@ -82,7 +82,7 @@
"gl-mat4": "^1.2.0",
"gl-mesh3d": "^2.3.0",
"gl-plot2d": "^1.4.3",
"gl-plot3d": "^2.4.1",
"gl-plot3d": "^2.4.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

result === false &&
userAgent.indexOf('Macintosh') !== -1 &&
userAgent.indexOf('Safari') !== -1 &&
navigator.maxTouchPoints > 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you find this solution?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var tablet = isTablet();

function isTablet() {
var navigator = window.navigator;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does is-mobile setup a guard for cases when window.navigator is undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any check there concerning navigator.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, can you add one just to be sure?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I wouldn't someone running plotly.js in some sort of weird environment have their app break in a patch release)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it is added in 436fca4 here:

if(!ua && typeof navigator !== 'undefined') ua = navigator.userAgent;

Copy link
Contributor

@etpinard etpinard Feb 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, we can still get breakage on this line below:

navigator.maxTouchPoints > 1

if window.navigator isn't defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in aa28eba.


function isTablet() {
var navigator = window.navigator;
var userAgent = navigator.userAgent;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and similarly here, if is-mobile guards against undefined navigator.userAgent, we should too here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revised in 436fca4.

@etpinard
Copy link
Contributor

etpinard commented Feb 3, 2020

Sweet. Thanks very much

💃 - once tests pass!

@archmoj
Copy link
Contributor Author

archmoj commented Feb 3, 2020

@etpinard Thanks for the review.
After this I would open a PR on is-mobile to possibly simply this for future.

@archmoj
Copy link
Contributor Author

archmoj commented Feb 3, 2020

@etpinard Thanks for the review.
After this I would open a PR on is-mobile to possibly simply this for future.

PR to is-mobile: juliangruber/is-mobile#22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iPad Pro 12.9 (13) and iPad 7th (13) Not Detected Properly using Safari
2 participants