carbon-react 123.11.1 → 123.11.2

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.
@@ -14,6 +14,12 @@ export default function useModalAria(containerRef) {
14
14
  "aria-hidden": rootElement.getAttribute("aria-hidden"),
15
15
  inert: rootElement.getAttribute("inert")
16
16
  });
17
+ // need to manually call the blur event on any currently-focused element that might be inside the element
18
+ // we're making inert, since Firefox fails to do this, which can result in the focus styles remaining on
19
+ // an input that is no longer focused
20
+ if (rootElement.contains(document.activeElement)) {
21
+ document.activeElement?.blur();
22
+ }
17
23
  rootElement.setAttribute("aria-hidden", "true");
18
24
  rootElement.setAttribute("inert", "");
19
25
  } else if (rootElement !== topModal) {
@@ -21,6 +21,12 @@ function useModalAria(containerRef) {
21
21
  "aria-hidden": rootElement.getAttribute("aria-hidden"),
22
22
  inert: rootElement.getAttribute("inert")
23
23
  });
24
+ // need to manually call the blur event on any currently-focused element that might be inside the element
25
+ // we're making inert, since Firefox fails to do this, which can result in the focus styles remaining on
26
+ // an input that is no longer focused
27
+ if (rootElement.contains(document.activeElement)) {
28
+ document.activeElement?.blur();
29
+ }
24
30
  rootElement.setAttribute("aria-hidden", "true");
25
31
  rootElement.setAttribute("inert", "");
26
32
  } else if (rootElement !== topModal) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "123.11.1",
3
+ "version": "123.11.2",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",