From 010c5d82a66acd7989cbafef17707283b59a6efa Mon Sep 17 00:00:00 2001 From: Kiarokh Moattar Date: Mon, 2 Dec 2024 13:57:26 +0100 Subject: [PATCH] feat(menu): make it easier to distinguish menu choices in analytics software 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. --- src/components/menu-list/menu-list-renderer.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/menu-list/menu-list-renderer.tsx b/src/components/menu-list/menu-list-renderer.tsx index cef89c9f86..b44761f94e 100644 --- a/src/components/menu-list/menu-list-renderer.tsx +++ b/src/components/menu-list/menu-list-renderer.tsx @@ -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)}