@bonniernews/dn-design-system-web 10.0.2 → 10.0.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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
4
4
 
5
5
 
6
6
 
7
+ ## [10.0.3](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@10.0.2...@bonniernews/dn-design-system-web@10.0.3) (2024-01-16)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **web:** no scroll when dialog is open ([#1169](https://github.com/BonnierNews/dn-design-system/issues/1169)) ([9054857](https://github.com/BonnierNews/dn-design-system/commit/9054857723940c9014ae30f096e8d80140726e6b))
13
+
7
14
  ## [10.0.2](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@10.0.1...@bonniernews/dn-design-system-web@10.0.2) (2024-01-16)
8
15
 
9
16
 
@@ -20,6 +20,7 @@ function initModal(modalEl) {
20
20
  fallbackDiv.setAttribute("aria-modal", "true");
21
21
  fallbackDiv.innerHTML = modalElInner.innerHTML;
22
22
  modalEl.replaceChild(fallbackDiv, modalElInner);
23
+ document.body.classList.add("no-scroll");
23
24
  }
24
25
 
25
26
  modalEl.addEventListener("click", (e) => {
@@ -49,6 +50,7 @@ function closeModal(modalEl, isDialogSupported) {
49
50
  modalElInner.close();
50
51
  } else {
51
52
  modalEl.classList.add("ds-modal--hidden");
53
+ document.body.classList.remove("no-scroll");
52
54
  }
53
55
  }
54
56
 
@@ -3,6 +3,12 @@
3
3
  @use "../../components/button/button.scss";
4
4
  @use "../../components/icon-button/icon-button.scss";
5
5
 
6
+ body:has(dialog[open]),
7
+ body.no-scroll {
8
+ overflow: hidden;
9
+ touch-action: none;
10
+ }
11
+
6
12
  .ds-modal {
7
13
  &--fallback.ds-modal--hidden {
8
14
  display: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "10.0.2",
3
+ "version": "10.0.3",
4
4
  "description": "DN design system for web.",
5
5
  "main": "index.js",
6
6
  "homepage": "https://github.com/BonnierNews/dn-design-system/tree/main/web/src#readme",