@angular/cdk 11.2.9 → 11.2.13

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.
@@ -937,22 +937,22 @@
937
937
  /** Add a new overlay to the list of attached overlay refs. */
938
938
  OverlayOutsideClickDispatcher.prototype.add = function (overlayRef) {
939
939
  _super.prototype.add.call(this, overlayRef);
940
- // tslint:disable: max-line-length
941
940
  // Safari on iOS does not generate click events for non-interactive
942
941
  // elements. However, we want to receive a click for any element outside
943
942
  // the overlay. We can force a "clickable" state by setting
944
- // `cursor: pointer` on the document body.
945
- // See https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event#Safari_Mobile
946
- // and https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
947
- // tslint:enable: max-line-length
943
+ // `cursor: pointer` on the document body. See:
944
+ // https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event#Safari_Mobile
945
+ // https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
948
946
  if (!this._isAttached) {
949
- this._document.body.addEventListener('click', this._clickListener, true);
950
- this._document.body.addEventListener('contextmenu', this._clickListener, true);
947
+ var body = this._document.body;
948
+ body.addEventListener('click', this._clickListener, true);
949
+ body.addEventListener('auxclick', this._clickListener, true);
950
+ body.addEventListener('contextmenu', this._clickListener, true);
951
951
  // click event is not fired on iOS. To make element "clickable" we are
952
952
  // setting the cursor to pointer
953
953
  if (this._platform.IOS && !this._cursorStyleIsSet) {
954
- this._cursorOriginalValue = this._document.body.style.cursor;
955
- this._document.body.style.cursor = 'pointer';
954
+ this._cursorOriginalValue = body.style.cursor;
955
+ body.style.cursor = 'pointer';
956
956
  this._cursorStyleIsSet = true;
957
957
  }
958
958
  this._isAttached = true;
@@ -961,10 +961,12 @@
961
961
  /** Detaches the global keyboard event listener. */
962
962
  OverlayOutsideClickDispatcher.prototype.detach = function () {
963
963
  if (this._isAttached) {
964
- this._document.body.removeEventListener('click', this._clickListener, true);
965
- this._document.body.removeEventListener('contextmenu', this._clickListener, true);
964
+ var body = this._document.body;
965
+ body.removeEventListener('click', this._clickListener, true);
966
+ body.removeEventListener('auxclick', this._clickListener, true);
967
+ body.removeEventListener('contextmenu', this._clickListener, true);
966
968
  if (this._platform.IOS && this._cursorStyleIsSet) {
967
- this._document.body.style.cursor = this._cursorOriginalValue;
969
+ body.style.cursor = this._cursorOriginalValue;
968
970
  this._cursorStyleIsSet = false;
969
971
  }
970
972
  this._isAttached = false;