@kiva/kv-components 3.91.0 → 3.91.1

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
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.91.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.91.0...@kiva/kv-components@3.91.1) (2024-08-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * resolve issue found in ui vue migration ([0050e5e](https://github.com/kiva/kv-ui-elements/commit/0050e5e93cf189f18fda0c468a577546f5f1911c))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.91.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.90.5...@kiva/kv-components@3.91.0) (2024-08-14)
7
18
 
8
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "3.91.0",
3
+ "version": "3.91.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -82,5 +82,5 @@
82
82
  "optional": true
83
83
  }
84
84
  },
85
- "gitHead": "d7a9fad77e1a68fd3d4483619c937c37a3807503"
85
+ "gitHead": "1a5c4e9cb95e6a1bd8fb33a423c267b6c46e570e"
86
86
  }
@@ -217,16 +217,23 @@ export default {
217
217
  const kvLightbox = ref(null);
218
218
  const kvLightboxBody = ref(null);
219
219
  const controlsRef = ref(null);
220
+ const activateFocusTrap = ref(null);
221
+ const deactivateFocusTrap = ref(null);
220
222
 
221
- const trapElements = computed(() => [
222
- kvLightbox.value, // This lightbox
223
- '[role="alert"]', // Any open toasts/alerts on the page
224
- ]);
225
- const {
226
- activate: activateFocusTrap,
227
- deactivate: deactivateFocusTrap,
228
- } = useFocusTrap(trapElements, {
229
- allowOutsideClick: true, // allow clicking outside the lightbox to close it
223
+ // Ensure the lightbox ref isn't null
224
+ nextTick(() => {
225
+ const trapElements = computed(() => [
226
+ kvLightbox.value, // This lightbox
227
+ '[role="alert"]', // Any open toasts/alerts on the page
228
+ ]);
229
+ const {
230
+ activate,
231
+ deactivate,
232
+ } = useFocusTrap(trapElements, {
233
+ allowOutsideClick: true, // allow clicking outside the lightbox to close it
234
+ });
235
+ activateFocusTrap.value = activate;
236
+ deactivateFocusTrap.value = deactivate;
230
237
  });
231
238
 
232
239
  let makePageInertCallback = null;
@@ -242,7 +249,7 @@ export default {
242
249
  const hide = (closedBy = '') => {
243
250
  // scroll any content inside the lightbox back to top
244
251
  if (kvLightbox.value && kvLightboxBody.value) {
245
- deactivateFocusTrap();
252
+ deactivateFocusTrap.value?.();
246
253
  kvLightboxBody.value.scrollTop = 0;
247
254
  unlockPrintSingleEl(kvLightboxBody.value);
248
255
  }
@@ -279,7 +286,7 @@ export default {
279
286
 
280
287
  nextTick(() => {
281
288
  if (kvLightbox.value && kvLightboxBody.value) {
282
- activateFocusTrap();
289
+ activateFocusTrap.value?.();
283
290
  makePageInertCallback = makePageInert(kvLightbox.value);
284
291
  lockPrintSingleEl(kvLightboxBody.value);
285
292
  }