Replies: 1 comment 1 reply
-
@gcattan Chart.js has already got in roadmap for next versions to address the accessibility topic. const plugin = {
id: 'mousedown',
events: ['mousedown'],
afterEvent(chart, args) {
const event = args.event;
const interaction = chart.options.interaction;
const elements = chart.getElementsAtEventForMode(event, interaction.mode, interaction, true);
chart.options.onClick(event, elements, chart);
}
};
options: {
events: ['mousedown'],
onClick() {
alert('Click!');
}
} See codepen: https://codepen.io/stockinail/pen/jOeppwj |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
ChartOptions accepts an
onClick
listener reacting onclick
andmouseup
events.How can I implement a
onmousedown
event to detect that enter was pressed on an element?The idea is to improve keyboard navigation and accessibility.
Beta Was this translation helpful? Give feedback.
All reactions