Skip to content

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

Merged
archmoj merged 3 commits into
masterfrom
fix-webgl-ipad-pro
Feb 3, 2020
Merged

Fix 3-D config for webgl buffer on iPad Pro & iPad 7th + iOs v13 + Safari #4546
archmoj merged 3 commits into
masterfrom
fix-webgl-ipad-pro

Conversation

@archmoj

Copy link
Copy Markdown
Contributor

Fixes#4502 | Demo

@plotly/plotly_js
cc: @jackparmer

@archmojarchmoj added bug something broken status: reviewable labels Feb 3, 2020
Comment threadpackage.json
"gl-mesh3d": "^2.3.0",
"gl-plot2d": "^1.4.3",
"gl-plot3d": "^2.4.1",
"gl-plot3d": "^2.4.2",

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Comment threadsrc/plots/gl3d/scene.js Outdated
var tablet = isTablet();

function isTablet() {
var navigator = window.navigator;

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Good call.

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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&&typeofnavigator!=='undefined')ua=navigator.userAgent;

@etpinardetpinardFeb 3, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Addressed in aa28eba.

Comment threadsrc/plots/gl3d/scene.js Outdated

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

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Good call.

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
Contributor

Sweet. Thanks very much

💃 - once tests pass!

@archmoj

Copy link
Copy Markdown
ContributorAuthor

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

@archmoj

Copy link
Copy Markdown
ContributorAuthor

@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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugsomething 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

@archmoj@etpinard