From f9930122b5064fe3009d3f76120f43bdc0c432dd Mon Sep 17 00:00:00 2001
From: RasmusKjeldgaard
Date: Tue, 19 Nov 2024 17:16:19 +0100
Subject: [PATCH] More readability
---
.../app/showcase/alert-showcase/alert-showcase.component.html | 2 +-
.../app/showcase/modal-showcase/modal-showcase.component.html | 4 ++--
.../helpers/src/content-mutation-observer.spec.ts | 2 +-
libs/designsystem/helpers/src/content-mutation-observer.ts | 4 ++--
libs/designsystem/helpers/src/element-ancestor-utils.ts | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/apps/cookbook/src/app/showcase/alert-showcase/alert-showcase.component.html b/apps/cookbook/src/app/showcase/alert-showcase/alert-showcase.component.html
index b7c620ee53..39f79246cf 100644
--- a/apps/cookbook/src/app/showcase/alert-showcase/alert-showcase.component.html
+++ b/apps/cookbook/src/app/showcase/alert-showcase/alert-showcase.component.html
@@ -52,7 +52,7 @@ Accessibility
back to where it was before showing the alert.
- Meaningful titles
+ Labeling
The alert title is automatically used as a label to add context for assistive technologies. For
example, screen readers use the label to announce when the modal dialog appears and to give
diff --git a/apps/cookbook/src/app/showcase/modal-showcase/modal-showcase.component.html b/apps/cookbook/src/app/showcase/modal-showcase/modal-showcase.component.html
index 0560454bfd..52152d1108 100644
--- a/apps/cookbook/src/app/showcase/modal-showcase/modal-showcase.component.html
+++ b/apps/cookbook/src/app/showcase/modal-showcase/modal-showcase.component.html
@@ -679,7 +679,7 @@
Accessibility
dismisses the modal.
-Labeling modals
+Labeling
The provided
kirby-page-title
@@ -687,7 +687,7 @@
Labeling modals
readers use the label to announce when the modal dialog appears and to give proper context when
interacting with the content within.
-This emphasizes the importance of providing a meaningful title for all alerts.
+This emphasizes the importance of providing a meaningful title for all modals.
Compact Modals
diff --git a/libs/designsystem/helpers/src/content-mutation-observer.spec.ts b/libs/designsystem/helpers/src/content-mutation-observer.spec.ts
index 6a1005f507..7c7eddb152 100644
--- a/libs/designsystem/helpers/src/content-mutation-observer.spec.ts
+++ b/libs/designsystem/helpers/src/content-mutation-observer.spec.ts
@@ -25,7 +25,7 @@ class ContentObserverHostComponent implements OnDestroy {
}
}
-describe('Content Mutation Observer', () => {
+describe('observeContent', () => {
let spectator: Spectator;
const createComponent = createComponentFactory({
diff --git a/libs/designsystem/helpers/src/content-mutation-observer.ts b/libs/designsystem/helpers/src/content-mutation-observer.ts
index bfee394d36..85be34e8ac 100644
--- a/libs/designsystem/helpers/src/content-mutation-observer.ts
+++ b/libs/designsystem/helpers/src/content-mutation-observer.ts
@@ -31,7 +31,7 @@ function shouldIgnoreMutationRecord(record: MutationRecord) {
export function observeContent(
observedElement: HTMLElement,
contentChangedCallback: () => void,
- disconnect$: Observable
+ unobserve$?: Observable
): MutationObserver {
const mutationObserver = new MutationObserver((mutations) => {
const filteredMutations = mutations.filter((mutation) => !shouldIgnoreMutationRecord(mutation));
@@ -46,7 +46,7 @@ export function observeContent(
subtree: true,
});
- disconnect$.subscribe(() => {
+ unobserve$?.subscribe(() => {
mutationObserver.disconnect();
});
diff --git a/libs/designsystem/helpers/src/element-ancestor-utils.ts b/libs/designsystem/helpers/src/element-ancestor-utils.ts
index 427889d20c..7c568d7875 100644
--- a/libs/designsystem/helpers/src/element-ancestor-utils.ts
+++ b/libs/designsystem/helpers/src/element-ancestor-utils.ts
@@ -28,7 +28,7 @@ export const elementHasAncestor = (
};
/*
- * Utility function to get the closest ancestor modal and
+ * Utility function to find the closest ancestor modal and
* get the element with a dialog role from within its shadow root.
*/
export function getModalDialogAncestor(currentElement: HTMLElement): HTMLElement | undefined {