patternfly-elements icon indicating copy to clipboard operation
patternfly-elements copied to clipboard

Events from pfe-content-set don't provide enough information to provide good analytics

Open wesruv opened this issue 4 years ago • 5 comments

Description of the issue

When an accordion (maybe tab as well) is clicked in pfe-content-set there isn't enough information to tell what has been expanded/collapsed, making analytics based on interaction impossible.

Impacted component(s)

  • pfe-tabs
  • pfe-accordion
  • pfe-content-set

Steps to reproduce

  1. Go to https://www.redhat.com/en/contact
  2. In the console, add:
document.addEventListener('pfe-accordion:change', function(event) {
  debugger;
});
  1. Click on an accordion to expand
  2. Event object target is set to pfe-content-set
  3. event.path does not exist in all browsers (but would fix the issue if it were)
  4. Since accordions do not close siblings there isn't a reliable way to tell what was just opened without event.path

wesruv avatar Aug 31 '21 16:08 wesruv

PR is ready #IMO https://github.com/patternfly/patternfly-elements/pull/1769

wesruv avatar Sep 03 '21 17:09 wesruv

Turned out this was only an issue with accordion.

wesruv avatar Sep 03 '21 17:09 wesruv

Is this still relevant with 2.0's new events?

bennypowers avatar Feb 24 '22 12:02 bennypowers

The issue wasn't the event system so much as the lack of data that was transmitted with the event.

Since we haven't moved PFE Content Set to PFE 2.0, this will be an issue for what replaces it (if something replaces it?).

wesruv avatar Feb 24 '22 18:02 wesruv

In that case we'll transfer this issue to RHDS when it's available

bennypowers avatar Feb 24 '22 20:02 bennypowers