Amphtml: legacy carousel: high-trust slideChange event when slide is changed without a user gesture.

Created on 28 Feb 2019  路  12Comments  路  Source: ampproject/amphtml

Summary

slideChange event of amp-carousel fires whenever a slide changes. Currently this event fires as a hight-trust event in all cases.

Starting April 2, 2019 (6 weeks from now based on AMP's deprecation policy). This event will start firing as low-trust when a slide is changed without user interaction such as result of autoplay or when goToSlide action is called from a low-trust event such as scroll

If users manually change slides, the event would still be high-trust.

How to migrate

If you are not using the slideChange event when autoplay is set on amp-carousel or when toGoSlide is called from a low-trust event, this change does not impact you.

If you rely on running an action when slides changes automatically or via low-trust events such as scroll or video play, make sure you only call an action that accepts low-trust events such as amp-animation's start event. (which can be used to change certain CSS properties such as opacity, transform and visibility)

Reason

This changes was not intended and was made by mistake. AMP does not allow high-trust events without user-interaction to prevent disruptive UI changes without user's involvement.

Related issues:

https://github.com/ampproject/amphtml/issues/12206 https://github.com/ampproject/amphtml/issues/20697

@leonalicious @88kbbq
@ampproject/wg-ui-and-a11y @choumx we require 3 core committer approvals to proceed. Please reply with your objections or approvals.

amp-base-carousel amp-carousel INTENT TO IMPLEMENT Bug Deprecation components

Most helpful comment

giphy

All 12 comments

I approve of this change. I just want to make sure that we preserve the trust level if the slide change occurred via an action (since changing slides requires a low trust action). So a low trust action changing slides should result in a low trust event, and a high trust action should result in a high trust event.

@sparhami agreed. Updated accordingly

As per the deprecation policy here we needed to allow for at least 2 weeks of open discussion. This discussion had been happening here as per OP's post. We can proceed with the process by getting 3 approvals from core committers.

Approve.
Noting that:

If users manually change slides, the event would still be high-trust.

Approve.

giphy

Approve with the understanding that this feature has less usage than a deprecation threshold and has been out for <6 months.

Would ask that we do outreach about this (discussion forum + Slack) so that we can get some attention on this so that potentially affected partners can be alerted (not everyone checks GitHub)

LGTM

Reminder that this will be disabled in 2 weeks.

We are delaying this by 3 weeks to allow more time for changes. New effective date is April 23
/cc @leonalicious @ampproject/wg-ui-and-a11y

@ampproject/wg-ui-and-a11y @nainar:

I have looked at some usages of this and all of them seem be to for dots UI in Carousel. I have not found any abuse cases yet.

Given:

  • We don't have a solution for updating dots with autoplay for carousel until amp-inline-gallery is launched
  • There are no abuse cases yet.

I like to suggest we postpone this deprecation until after amp-inline-gallery is launched.

Thoughts?

@sparhami let's disable this when inline-gallery is launched so folks can migrate and still have dots (that's the main use-case for this)

Was this page helpful?
0 / 5 - 0 ratings