@angular/cdk 13.1.2 → 13.1.3

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/fesm2020/a11y.mjs CHANGED
@@ -1484,10 +1484,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImpor
1484
1484
  function isFakeMousedownFromScreenReader(event) {
1485
1485
  // Some screen readers will dispatch a fake `mousedown` event when pressing enter or space on
1486
1486
  // a clickable element. We can distinguish these events when both `offsetX` and `offsetY` are
1487
- // zero. Note that there's an edge case where the user could click the 0x0 spot of the screen
1488
- // themselves, but that is unlikely to contain interaction elements. Historically we used to
1489
- // check `event.buttons === 0`, however that no longer works on recent versions of NVDA.
1490
- return event.offsetX === 0 && event.offsetY === 0;
1487
+ // zero or `event.buttons` is zero, depending on the browser:
1488
+ // - `event.buttons` works on Firefox, but fails on Chrome.
1489
+ // - `offsetX` and `offsetY` work on Chrome, but fail on Firefox.
1490
+ // Note that there's an edge case where the user could click the 0x0 spot of the
1491
+ // screen themselves, but that is unlikely to contain interactive elements.
1492
+ return event.buttons === 0 || (event.offsetX === 0 && event.offsetY === 0);
1491
1493
  }
1492
1494
  /** Gets whether an event could be a faked `touchstart` event dispatched by a screen reader. */
1493
1495
  function isFakeTouchstartFromScreenReader(event) {