amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Share Button amp-story-player dispatch event click

Open Eliandromeda opened this issue 5 years ago • 6 comments

Description

I am trying to listen to a share button with a custom event, however, there's no click event associated with it.

Screen Shot 2021-07-14 at 10 25 23 AM

Reproduction Steps

  1. Click on the share button
  2. Try to use an Custom Event like , navigation, storyNavigation Example:

document.querySelectorAll('amp-story-player').addEventListener('navigation', (event) => { console.log('click to share button'); })

Relevant Logs

No response

Browser(s) Affected

Chrome, Firefox, Safari, Edge, UC Browser

OS(s) Affected

No response

Device(s) Affected

No response

AMP Version Affected

v0

Eliandromeda avatar Jul 14 '21 15:07 Eliandromeda

@Enriqe can I assign this issue to you? Will leave it up to you to set the priority.

dmanek avatar Jul 15 '21 22:07 dmanek

/cc @gmajoulet

Enriqe avatar Jul 16 '21 14:07 Enriqe

Can you try to replace the navigation event you're listening to with the correct one you configured? Cf our documentation: https://github.com/ampproject/amphtml/blob/main/docs/spec/amp-story-player.md#customizing-position--visibility-of-story-ui-controls

gmajoulet avatar Jul 19 '21 18:07 gmajoulet

I didn't configure it on Controls, I am using the share control that comes with an external WebStory inside an iframe so I am trying to use any of the API events to catch the onclick event but no one takes this event.

Screen Shot 2021-07-21 at 11 30 19 AM

if I create a control this will lose the original behavior of the Share control button of external webstory so that's why I need another event maybe that comes from the API to track this share control click.

Eliandromeda avatar Jul 21 '21 16:07 Eliandromeda

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 19 '22 04:10 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 26 '25 23:04 stale[bot]