@carbon/charts-vue 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/charts-vue.umd.js CHANGED
@@ -36598,27 +36598,6 @@ var hover_axis_HoverAxis = /** @class */ (function (_super) {
36598
36598
  .attr('width', width + configuration_non_customizable_axis.hover.rectanglePadding * 2)
36599
36599
  .attr('height', height)
36600
36600
  .lower();
36601
- // Add keyboard event listeners to each group element
36602
- g.on('keydown', function (event) {
36603
- // Choose specific arrow key depending on the axis
36604
- if (axisPosition === AxisPositions.LEFT ||
36605
- axisPosition === AxisPositions.RIGHT) {
36606
- if (event.key && event.key === 'ArrowUp') {
36607
- self.goNext(this, event);
36608
- }
36609
- else if (event.key && event.key === 'ArrowDown') {
36610
- self.goPrevious(this, event);
36611
- }
36612
- }
36613
- else {
36614
- if (event.key && event.key === 'ArrowLeft') {
36615
- self.goPrevious(this, event);
36616
- }
36617
- else if (event.key && event.key === 'ArrowRight') {
36618
- self.goNext(this, event);
36619
- }
36620
- }
36621
- });
36622
36601
  });
36623
36602
  // Add event listeners to element group
36624
36603
  this.addEventListeners();
@@ -36707,6 +36686,35 @@ var hover_axis_HoverAxis = /** @class */ (function (_super) {
36707
36686
  element: src_select(this),
36708
36687
  datum: src_select(this).select('text').datum(),
36709
36688
  });
36689
+ })
36690
+ .on('keydown', function (event) {
36691
+ // Hide the tooltip when `Escape` is pressed, but keep focus
36692
+ if (event.key && event.key === 'Escape') {
36693
+ self.services.events.dispatchEvent(Events.Tooltip.HIDE);
36694
+ self.services.events.dispatchEvent(Events.Axis.LABEL_BLUR, {
36695
+ event: event,
36696
+ element: src_select(this),
36697
+ datum: src_select(this).select('text').datum(),
36698
+ });
36699
+ }
36700
+ // Choose specific arrow key depending on the axis
36701
+ if (axisPosition === AxisPositions.LEFT ||
36702
+ axisPosition === AxisPositions.RIGHT) {
36703
+ if (event.key && event.key === 'ArrowUp') {
36704
+ self.goNext(this, event);
36705
+ }
36706
+ else if (event.key && event.key === 'ArrowDown') {
36707
+ self.goPrevious(this, event);
36708
+ }
36709
+ }
36710
+ else {
36711
+ if (event.key && event.key === 'ArrowLeft') {
36712
+ self.goPrevious(this, event);
36713
+ }
36714
+ else if (event.key && event.key === 'ArrowRight') {
36715
+ self.goNext(this, event);
36716
+ }
36717
+ }
36710
36718
  });
36711
36719
  };
36712
36720
  // Focus on the next HTML element sibling