codexly-ui 0.14.2 → 0.14.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/fesm2022/codexly-ui.mjs +13 -0
- package/fesm2022/codexly-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/codexly-ui.d.ts +12 -12
package/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -9412,6 +9412,11 @@ class ClxModalService {
|
|
|
9412
9412
|
{ provide: CLX_MODAL_SIZE, useValue: size },
|
|
9413
9413
|
],
|
|
9414
9414
|
});
|
|
9415
|
+
// The element that had focus right before opening (typically the button that triggered
|
|
9416
|
+
// this modal) — its own hover/focus tooltip, if any, never receives a real blur otherwise:
|
|
9417
|
+
// focus stays parked on it for as long as the modal is open, so switching OS windows while
|
|
9418
|
+
// it's open can leave a hover-triggered tooltip stuck with no blur/mouseleave to dismiss it.
|
|
9419
|
+
const triggerEl = document.activeElement;
|
|
9415
9420
|
const { compRef, overlayRef } = this._overlay.mount(component, innerInjector, {
|
|
9416
9421
|
zIndex: 1000,
|
|
9417
9422
|
backdrop: hasBackdrop,
|
|
@@ -9421,6 +9426,11 @@ class ClxModalService {
|
|
|
9421
9426
|
panelEl.style.width = `min(calc(100vw - 2rem), ${maxWidth})`;
|
|
9422
9427
|
panelEl.style.maxWidth = maxWidth;
|
|
9423
9428
|
panelEl.style.maxHeight = '90vh';
|
|
9429
|
+
// Move focus into the modal so the trigger element actually blurs (see triggerEl above).
|
|
9430
|
+
// tabIndex -1 + outline:none keeps this a pure focus target, not a visible/tabbable stop.
|
|
9431
|
+
panelEl.tabIndex = -1;
|
|
9432
|
+
panelEl.style.outline = 'none';
|
|
9433
|
+
panelEl.focus();
|
|
9424
9434
|
// Enter animation
|
|
9425
9435
|
this._animate.animate(panelEl, {
|
|
9426
9436
|
animation: animationIn,
|
|
@@ -9438,6 +9448,9 @@ class ClxModalService {
|
|
|
9438
9448
|
fillMode: 'forwards',
|
|
9439
9449
|
}).then(() => {
|
|
9440
9450
|
overlayRef.destroy();
|
|
9451
|
+
// Restore focus to whatever opened this modal — standard modal a11y practice, and what
|
|
9452
|
+
// lets that element's tooltip (if any) receive a real blur instead of staying stuck.
|
|
9453
|
+
triggerEl?.focus?.();
|
|
9441
9454
|
_resolve(result);
|
|
9442
9455
|
});
|
|
9443
9456
|
};
|