@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.
- package/_a11y.scss +4 -0
- package/a11y/_a11y.scss +4 -0
- package/a11y-prebuilt.css +1 -1
- package/bundles/cdk-a11y.umd.js +6 -1
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +5 -5
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +14 -12
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +4 -4
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-testing.umd.js +41 -4
- package/bundles/cdk-testing.umd.js.map +1 -1
- package/bundles/cdk-testing.umd.min.js +4 -4
- package/bundles/cdk-testing.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/esm2015/a11y/focus-trap/focus-trap.js +7 -2
- package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +15 -13
- package/esm2015/testing/component-harness.js +42 -4
- package/esm2015/version.js +1 -1
- package/fesm2015/a11y.js +6 -1
- package/fesm2015/a11y.js.map +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/overlay.js +14 -12
- package/fesm2015/overlay.js.map +1 -1
- package/fesm2015/testing.js +41 -3
- package/fesm2015/testing.js.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
|
@@ -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
|
-
//
|
|
946
|
-
//
|
|
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
|
|
950
|
-
|
|
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 =
|
|
955
|
-
|
|
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
|
|
965
|
-
|
|
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
|
-
|
|
969
|
+
body.style.cursor = this._cursorOriginalValue;
|
|
968
970
|
this._cursorStyleIsSet = false;
|
|
969
971
|
}
|
|
970
972
|
this._isAttached = false;
|