@marianmeres/stuic 1.109.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,10 +46,10 @@ onMount(() => {
46
46
  document.addEventListener("keydown", _handleKeyDown, true);
47
47
  _unsubs.push(() => document.removeEventListener("keydown", _handleKeyDown, true));
48
48
  const _handleClick = (e) => {
49
- if (_open && closeOnOutsideClick && /dialog/i.test(e.target?.tagName)) {
50
- close();
51
- } else if (_open) {
49
+ if (_open) {
52
50
  e.stopPropagation();
51
+ if (closeOnOutsideClick && e.target === _el)
52
+ return close();
53
53
  }
54
54
  };
55
55
  _el.addEventListener("click", _handleClick);
@@ -68,7 +68,14 @@ onMount(() => {
68
68
  class={`${_class} ${backdropFadeIn || ''}`}
69
69
  >
70
70
  {#if _open}
71
- <slot />
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>
72
79
  {/if}
73
80
  </dialog>
74
81
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/stuic",
3
- "version": "1.109.0",
3
+ "version": "1.110.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package && node ./scripts/date.js",