diff --git a/packages/visualizations/src/components/Legend/CategoryLegend/Item/CategoryLegendItem.svelte b/packages/visualizations/src/components/Legend/CategoryLegend/Item/CategoryLegendItem.svelte index cad39bfc..b73471d1 100644 --- a/packages/visualizations/src/components/Legend/CategoryLegend/Item/CategoryLegendItem.svelte +++ b/packages/visualizations/src/components/Legend/CategoryLegend/Item/CategoryLegendItem.svelte @@ -8,14 +8,23 @@ export let toggleSerie: (index: number) => void; export let refined: boolean; + const onKeyDown = (event: KeyboardEvent) => { + if (event.key !== 'Enter' || !item.onClick) return; + toggleSerie(itemIndex); + item.onClick(itemIndex); + }; + $: stringLabel = item.label && (typeof item.label === 'string' ? item.label : item?.label?.text?.(itemIndex));
{ if (item.onClick) { toggleSerie(itemIndex);