@marianmeres/stuic 1.108.0 → 1.110.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.
|
@@ -46,7 +46,11 @@ onMount(() => {
|
|
|
46
46
|
document.addEventListener("keydown", _handleKeyDown, true);
|
|
47
47
|
_unsubs.push(() => document.removeEventListener("keydown", _handleKeyDown, true));
|
|
48
48
|
const _handleClick = (e) => {
|
|
49
|
-
|
|
49
|
+
if (_open) {
|
|
50
|
+
e.stopPropagation();
|
|
51
|
+
if (closeOnOutsideClick && e.target === _el)
|
|
52
|
+
return close();
|
|
53
|
+
}
|
|
50
54
|
};
|
|
51
55
|
_el.addEventListener("click", _handleClick);
|
|
52
56
|
_unsubs.push(() => _el.removeEventListener("click", _handleClick));
|
|
@@ -64,7 +68,14 @@ onMount(() => {
|
|
|
64
68
|
class={`${_class} ${backdropFadeIn || ''}`}
|
|
65
69
|
>
|
|
66
70
|
{#if _open}
|
|
67
|
-
|
|
71
|
+
<!--
|
|
72
|
+
wrapping into relative full h/w div so that the inner click will never trigger close
|
|
73
|
+
(this could be achieved in many different ways, but this seems to be the most
|
|
74
|
+
pragmatic when taking into account the consumer usage)
|
|
75
|
+
-->
|
|
76
|
+
<div class="relative w-full h-full">
|
|
77
|
+
<slot />
|
|
78
|
+
</div>
|
|
68
79
|
{/if}
|
|
69
80
|
</dialog>
|
|
70
81
|
|