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
Disable native snap point in slidescroll #7966
Disable native snap point in slidescroll #7966
Conversation
tested on other devices? platforms? |
d6e8332
to
aaf8b63
Compare
Also this is not a permanent fix , this is just a stop gap. So just flip the flag in the JS dont cleanup the code yet. We would need a permanant fix (or may be identify the issue and file a webkit bug that would be fixed soon) |
I just tested the code (disable native snap point) on real ios device and the autoplay iterating rapidly bug is fixed but there are other misbehaviors showing up. @camelburrito PS, I tried to debug what's wrong with the native snap point but didn't have a clue. |
I'm going to debug slidescroll custom snap and hopefully find a fix for the newly found misbehaviour: if user scrolls too much and reach the end of the next slide, the carousel will jump one more slide suddenly. |
Thanks to @camelburrito I figured out the fix for the sudden slide jump in ios. I will keep testing and commit coming. |
aaf8b63
to
f3b62cd
Compare
@camelburrito I removed |
f3b62cd
to
76a8a6b
Compare
No :(
On Fri, Mar 10, 2017 at 3:19 PM Yuxi Chen ***@***.***> wrote:
@camelburrito <https://github.com/camelburrito> I removed
handleCustomElasticScroll_ and the problem (jumping to one more slide
suddenly) is solved. I removed it in both android and ios cases and
confirmed the slidescroll still functional in both platforms. Do you think
it's ok to remove it?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#7966 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANd2kCs_UbZ2E_wm8TJPNNgrOm_eK9cyks5rkbBfgaJpZM4MSzHT>
.
--
You received this message because you are subscribed to the Google Groups
"amphtml-eng-github" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to ***@***.***
To post to this group, send email to ***@***.***
To view this discussion on the web visit
https://groups.google.com/a/google.com/d/msgid/amphtml-eng-github/ampproject/amphtml/pull/7966/c285774256%40github.com
<https://groups.google.com/a/google.com/d/msgid/amphtml-eng-github/ampproject/amphtml/pull/7966/c285774256%40github.com?utm_medium=email&utm_source=footer>
.
--
-- Sriram
|
@camelburrito I updated the heroku code with current PR code: http://yuxichen2.herokuapp.com/examples/test.amp.max.html (I added a test.amp.html in the heroku deployment), please check the swiping behavior. It seems great, I wonder why can't we remove |
76a8a6b
to
9f7dbac
Compare
Hi, ampproject bot here! Here are a list of the owners that can approve your files. You may leave an issue comment stating "@ampprojectbot retry!" to force me to re-evaluate this Pull Request's status /to cramforce dvoytenko
For any issues please file a bug at https://github.com/google/github-owners-bot/issues |
9f7dbac
to
09776d2
Compare
Ping @camelburrito @muxin, this is a P0. |
@jridgewell - we are working on it we have a solution and we are testing it out on lots of devices - taking a lot of time. @muxin Let me know when the device testing is done. |
09776d2
to
30cf942
Compare
Hi, ampproject bot here! Here are a list of the owners that can approve your files. You may leave an issue comment stating "@ampprojectbot retry!" to force me to re-evaluate this Pull Request's status /to camelburrito dvoytenko
For any issues please file a bug at https://github.com/google/github-owners-bot/issues |
30cf942
to
686021c
Compare
Hi, ampproject bot here! Here are a list of the owners that can approve your files. You may leave an issue comment stating "@ampprojectbot retry!" to force me to re-evaluate this Pull Request's status /to cramforce dvoytenko jridgewell
/to camelburrito dvoytenko
For any issues please file a bug at https://github.com/google/github-owners-bot/issues |
686021c
to
e337a6c
Compare
e337a6c
to
69c50ae
Compare
@camelburrito Testing on devices. But PTAL |
Tested, the android and ios non-beta behaves the same as before, and the ios beta uses custom snap without crazy slide switching. @camelburrito PTAL |
|
||
/** @private {boolean} */ | ||
this.isIosBeta_ = startsWith(platformFor(this.win).getIosVersionString(), | ||
'10.3'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should check if the version is > 10.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now the 10.3 is the only problematic version, I will create a followup issue for comparing IOS minor version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #8206
/** @private {boolean} */ | ||
this.isIosBetaExperimentOn_ = isExperimentOn(this.win, | ||
'slidescroll-ios-beta'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disable-css-snap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
'slidescroll-ios-beta'); | ||
|
||
/** @private {boolean} */ | ||
this.isIosBeta_ = startsWith(platformFor(this.win).getIosVersionString(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isCssSnapDisabled_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -139,6 +155,11 @@ export class AmpSlideScroll extends BaseSlides { | |||
// user. | |||
this.slidesContainer_.setAttribute('aria-live', 'polite'); | |||
|
|||
// Snap point is buggy in IOS 10.3 (beta), so it is disabled in beta. | |||
if (this.isIosBetaExperimentOn_ && this.isIosBeta_) { | |||
this.slidesContainer_.classList.add('-amp-disable-snap-type'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-amp-slidescroll-dsable-snap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
// Snap point is buggy in IOS 10.3 (beta), so it is disabled in beta. | ||
if (this.isIosBetaExperimentOn_ && this.isIosBeta_) { | ||
slideWrapper.classList.add('-amp-disable-snap-coordinate'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use only one class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -180,4 +180,12 @@ amp-carousel .amp-carousel-button.amp-disabled { | |||
overflow-y: hidden !important; | |||
-webkit-overflow-scrolling: touch !important; | |||
} | |||
|
|||
.-amp-disable-snap-type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.-amp-slidescroll-no-snap..-amp-slides-container {
scroll-snap-type: none !important;
}
.-amp-slidescroll-no-snap.-amp-slide-item {
scroll-snap-coordinate: none !important;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
tools/experiments/experiments.js
Outdated
{ | ||
id: 'slidescroll-ios-beta', | ||
name: 'Slidescroll IOS beta', | ||
cleanupIssue: 'https://github.com/ampproject/amphtml/issues/8195', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a spec and link the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
tools/experiments/experiments.js
Outdated
@@ -266,6 +266,11 @@ const EXPERIMENTS = [ | |||
spec: 'https://github.com/ampproject/amphtml/blob/master/extensions/' + | |||
'amp-sortable-table/amp-sortable-table.md', | |||
}, | |||
{ | |||
id: 'slidescroll-ios-beta', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the expt name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
'slidescroll-disable-css-snap'); | ||
|
||
/** @private {boolean} */ | ||
this.shouldDisableCssSnap_ = startsWith( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bring in the experiment here and use one boolean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Fixes #7670
Tested in ios 10.3 beta and 10.2