Open lars-hakansson opened 4 years ago
Did you find a work-around for this?
We found that you can disable it by setting tabindex on the tooltip-anchor. Something like:
ngAfterViewInit() { this.chartElement.nativeElement.querySelector('.tooltip-anchor').setAttribute('tabindex', -1); }
With that said, please go upvote https://github.com/swimlane/ngx-charts/issues/896 👍
the workaround by @kallebjork did not work for me, but it gave me an idea how to solve this. Here's what I had done:
const els = this.chart.nativeElement.querySelectorAll('[ngx-charts-bar]');
els.forEach(el => {
el.setAttribute('tabindex', -1);
});
https://stackblitz.com/edit/vertical-bar-chart-disable-focus
the workaround by @kallebjork did not work for me, but it gave me an idea how to solve this. Here's what I had done:
const els = this.chart.nativeElement.querySelectorAll('[ngx-charts-bar]'); els.forEach(el => { el.setAttribute('tabindex', -1); });
https://stackblitz.com/edit/vertical-bar-chart-disable-focus
@DmitryEfimenko Thanks..This worked for me with the pie-arc
chart
@ViewChild('chart', { read: ElementRef }) chartElement: ElementRef;
ngAfterViewInit() {
const els = this.chartElement.nativeElement.querySelectorAll(
'[ngx-charts-pie-arc]'
);
els.forEach((el: HTMLElement) => el.setAttribute('tabindex', '-1'));
}
Describe the bug I want to be able to set a property or something to disable focus so that taborder of my page supports a11y!
To Reproduce Steps to reproduce the behavior:
Or go to this stackblitz: https://stackblitz.com/edit/angular-5vyr3d
Expected behavior Setting disable tooltip or some new property should prevent tab:ing each svg element in the component.
ngx-charts version 13.0.3