Skip to content

Gear button on pile not working #16

@buuhuu

Description

@buuhuu

When I click the gear icon in the pile here https://main--exlm--buuhuu.hlx.page/en/dirk-demo nothing happens.

That seems to be related to this piece of code: https://github.com/adobe/aem-experimentation/blob/main/src/preview.js#L52-L75

  const actions = typeof header === 'object'
    ? (header.actions || []).map((action) => (action.href
      ? `<div class="hlx-button"><a href="${action.href}">${action.label}</a></div>`
      : `<div class="hlx-button"><a href="#">${action.label}</a></div>`))
    : [];
  // ...
  const buttons = [...popup.querySelectorAll('.hlx-popup-header-actions .hlx-button a')];
  actions.forEach((action, index) => {
    if (action.onclick) {
      buttons[index].addEventListener('click', action.onclick);
    }
  });

While the only item in header.actions has an onclick handler, the html string in the actions array does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions