@marianmeres/stuic 2.29.0 → 2.30.0
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.
|
@@ -392,6 +392,28 @@ export function popover(anchorEl, fn) {
|
|
|
392
392
|
}
|
|
393
393
|
// Render content
|
|
394
394
|
renderContent();
|
|
395
|
+
// Add close button for fallback mode (after content so it's not cleared)
|
|
396
|
+
if (!useAnchorPositioning && popoverEl) {
|
|
397
|
+
const closeBtn = document.createElement("button");
|
|
398
|
+
closeBtn.setAttribute("type", "button");
|
|
399
|
+
closeBtn.setAttribute("aria-label", "Close");
|
|
400
|
+
closeBtn.innerHTML = `<svg fill="none" viewBox="0 0 24 24" stroke-width="2.5" stroke="currentColor" style="width:1.25rem;height:1.25rem"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" /></svg>`;
|
|
401
|
+
closeBtn.style.cssText = `
|
|
402
|
+
position: absolute;
|
|
403
|
+
top: 0;
|
|
404
|
+
right: 0;
|
|
405
|
+
background: black;
|
|
406
|
+
color: white;
|
|
407
|
+
border: none;
|
|
408
|
+
border-bottom-left-radius: 0.5rem;
|
|
409
|
+
cursor: pointer;
|
|
410
|
+
opacity: 0.8;
|
|
411
|
+
padding: 0.33rem;
|
|
412
|
+
line-height: 1;
|
|
413
|
+
`;
|
|
414
|
+
closeBtn.addEventListener("click", hide);
|
|
415
|
+
popoverEl.appendChild(closeBtn);
|
|
416
|
+
}
|
|
395
417
|
// Transition in
|
|
396
418
|
popoverEl.classList.add("pop-block");
|
|
397
419
|
requestAnimationFrame(() => {
|