@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 CHANGED
@@ -9,6 +9,10 @@
9
9
  position: absolute;
10
10
  width: 1px;
11
11
 
12
+ // This works around a Chrome bug that can cause the tab to crash when large amounts of
13
+ // non-English text get wrapped: https://bugs.chromium.org/p/chromium/issues/detail?id=1201444
14
+ white-space: nowrap;
15
+
12
16
  // Avoid browsers rendering the focus ring in some cases.
13
17
  outline: 0;
14
18
 
package/a11y/_a11y.scss CHANGED
@@ -9,6 +9,10 @@
9
9
  position: absolute;
10
10
  width: 1px;
11
11
 
12
+ // This works around a Chrome bug that can cause the tab to crash when large amounts of
13
+ // non-English text get wrapped: https://bugs.chromium.org/p/chromium/issues/detail?id=1201444
14
+ white-space: nowrap;
15
+
12
16
  // Avoid browsers rendering the focus ring in some cases.
13
17
  outline: 0;
14
18
 
package/a11y-prebuilt.css CHANGED
@@ -1 +1 @@
1
- .cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;outline:0;-webkit-appearance:none;-moz-appearance:none}
1
+ .cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none}
@@ -1557,7 +1557,12 @@
1557
1557
  }
1558
1558
  };
1559
1559
  CdkTrapFocus.prototype._captureFocus = function () {
1560
- this._previouslyFocusedElement = this._document.activeElement;
1560
+ var _a, _b;
1561
+ // If the `activeElement` is inside a shadow root, `document.activeElement` will
1562
+ // point to the shadow root so we have to descend into it ourselves.
1563
+ var activeElement = (_a = this._document) === null || _a === void 0 ? void 0 : _a.activeElement;
1564
+ this._previouslyFocusedElement =
1565
+ ((_b = activeElement === null || activeElement === void 0 ? void 0 : activeElement.shadowRoot) === null || _b === void 0 ? void 0 : _b.activeElement) || activeElement;
1561
1566
  this.focusTrap.focusInitialElementWhenReady();
1562
1567
  };
1563
1568
  return CdkTrapFocus;