Skip to content
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

eventModifiers prop on Analytics component not working as expected #1042

Open
danielpickett opened this issue Mar 21, 2022 · 0 comments
Open

Comments

@danielpickett
Copy link
Contributor

🐛 Bug report

Regarding the 'eventModifiers' prop on the Analytics component from @availity/analytics: it does not work, as far as I can tell.

Current Behavior

I cannot get this prop to do anything useful. It's also unclear from the docs exactly how to use it.

Expected behavior

From the docs, I would expect that this prop would allow me to track any DOM element event I specify, outside of the 'click', 'focus' and 'blur' events already available through the data-analytics-action attribute. So I tried

<Analytics plugins={[splunkPlugin]} eventModifiers={['mouseenter']}>
  <div data-analytics-mouseenter="mouseenter">mouseenter</div>
</Analytics>

and

<Analytics plugins={[splunkPlugin]} eventModifiers={['mouseenter']}>
  <div data-analytics-action="mouseenter">mouseenter</div>
</Analytics>

and several other variations. Nothing worked.

Looking through the code for the AvAnalytics class that this implements, I don't see how listeners for any events other than 'click', 'focus' or 'blur' would ever get added. So my theory is that this became broken during a refactor at some point, or maybe it never worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant