Skip to content

Commit

Permalink
feat(menu): make it easier to distinguish menu choices in analytics s…
Browse files Browse the repository at this point in the history
…oftware like Heap

-CHANGELOG-
This change adds the value of the menu item's `text` property
under the attribute `data-text`, to make it possible to distinguish
which menu option was selected, in analytics apps like Heap.
Note that if you are putting any kind of sensitive data in the
`text` property of menu items, and you are using a service for
analysing user behaviour, such data could be sent to your analytics
service, which may be a violation of GDPR and other regulations.
If including such data in the menu item is absolutely necessary,
we recommend including it in the menu item's `data-secondary-text`
property instead.
  • Loading branch information
Kiarokh authored and adrianschmidt committed Dec 6, 2024
1 parent 55b45e7 commit 010c5d8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/components/menu-list/menu-list-renderer.tsx
Original file line number Diff line number Diff line change
@@ -139,6 +139,7 @@ export class MenuListRenderer {
aria-disabled={item.disabled ? 'true' : 'false'}
aria-selected={item.selected ? 'true' : 'false'}
data-index={index}
data-text={item.text}
{...attributes}
>
{this.renderIcon(this.config, item)}

0 comments on commit 010c5d8

Please sign in to comment.