Skip to content

Better scrolling on mobile devices - #311

Merged
cdata merged 1 commit into
masterfrom
better-mobile-scrolling
Jan 28, 2019
Merged

cdata merged 1 commit into
masterfrom
better-mobile-scrolling

Conversation

@cdata

@cdata cdata commented Jan 28, 2019

Copy link
Copy Markdown
Contributor

This change is a follow up to #288 . One of the primary goals of that change was to enable better interaction with pages containing <model-viewer> while scrolling. Due to a bug in the change, it turned out that mobile devices (or any that relied on touch input, really), still had a poor default interaction experience.

This change address scrolling on devices with touch input. Now all interaction (including via touch input) requires focus by default:

Fixes #75

@cdata
cdata requested review from jsantell and mrdoob January 28, 2019 16:59
jsantell
jsantell previously approved these changes Jan 28, 2019
Comment thread src/three-components/SmoothControls.ts Outdated
}

const rootNode = this.element.getRootNode() as Document | ShadowRoot;
return rootNode.activeElement === this.element;

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.

Maybe should ensure that the interaction policy is 'allow-when-focused' (had to check SmoothControls to see if these were the only two valid tokens for interaction policy)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍 will fix

@cdata
cdata merged commit 659c99c into master Jan 28, 2019
@cdata
cdata deleted the better-mobile-scrolling branch January 28, 2019 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants