@txstate-mws/svelte-components 1.3.4 → 1.3.6

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.
@@ -88,15 +88,15 @@ const focusin = (e) => {
88
88
  setInitialFocus();
89
89
  }
90
90
  };
91
- const windowclick = (_) => {
92
- if (state === 'active') {
91
+ const windowclick = (e) => {
92
+ if (state === 'active' && e.target instanceof HTMLElement && e.target.isConnected) {
93
93
  returnfocusto = undefined;
94
94
  dispatch('escape');
95
95
  }
96
96
  };
97
97
  </script>
98
- <svelte:window on:click={windowclick} />
99
- <div class={className} role="alertdialog" aria-modal="true" on:click|stopPropagation on:keydown|stopPropagation={keydown} on:focusin={focusin}>
98
+ <svelte:window on:mousedown={windowclick} />
99
+ <div class={className} role="alertdialog" aria-modal="true" on:click|stopPropagation on:mousedown|stopPropagation on:keydown|stopPropagation={keydown} on:focusin={focusin}>
100
100
  <!-- svelte-ignore a11y-no-noninteractive-tabindex -->
101
101
  <div bind:this={abovelockelement} tabindex="0"></div>
102
102
  <div bind:this={lockelement} on:keydown={keydown}>
@@ -10,6 +10,7 @@ declare const __propDef: {
10
10
  };
11
11
  events: {
12
12
  click: MouseEvent;
13
+ mousedown: MouseEvent;
13
14
  escape: CustomEvent<any>;
14
15
  } & {
15
16
  [evt: string]: CustomEvent<any>;
@@ -24,7 +24,7 @@ onMount(() => {
24
24
  </script>
25
25
 
26
26
  <!-- svelte-ignore a11y-click-events-have-key-events -->
27
- <div use:portal={usePortal} class="modal-backdrop" class:opaque on:click|stopPropagation|preventDefault={() => escapable && endmodal()}>
27
+ <div use:portal={usePortal} class="modal-backdrop" class:opaque on:mousedown|stopPropagation|preventDefault={() => escapable && endmodal()}>
28
28
  <FocusLock class="modal-container {containerClass}" {escapable} on:escape {hidefocus} {hidefocuslabel} {returnfocusto} {initialfocus}>
29
29
  <slot></slot>
30
30
  </FocusLock>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@txstate-mws/svelte-components",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "Svelte components that are generically useful.",
5
5
  "dependencies": {
6
6
  "@txstate-mws/svelte-store": "^1.0.3",