@spaethtech/svelte-ui 0.17.1-dev.82.2748ef4 → 0.17.1-dev.83.8520c1d
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.
|
@@ -222,10 +222,8 @@
|
|
|
222
222
|
class="cursor-pointer px-3 py-1.5 {i === highlight
|
|
223
223
|
? '[background-color:var(--ui-color-hover)]'
|
|
224
224
|
: ''} hover:[background-color:var(--ui-color-hover)]"
|
|
225
|
-
onpointerdown={(e) =>
|
|
226
|
-
|
|
227
|
-
choose(opt);
|
|
228
|
-
}}
|
|
225
|
+
onpointerdown={(e) => e.preventDefault()}
|
|
226
|
+
onclick={() => choose(opt)}
|
|
229
227
|
onpointerenter={() => (highlight = i)}
|
|
230
228
|
>
|
|
231
229
|
{opt}
|
|
@@ -535,6 +535,11 @@
|
|
|
535
535
|
</div>
|
|
536
536
|
{:else}
|
|
537
537
|
{#each allOptions() as option, index (option.value)}
|
|
538
|
+
<!-- Select on the full CLICK, not mousedown: if selection closes a hosting Popup (a Select in
|
|
539
|
+
a Dialog), doing it on mousedown tears the popover out of the top layer before mouseup,
|
|
540
|
+
so the mouseup + click land on whatever's underneath (e.g. a CardFooter button) — a
|
|
541
|
+
silent click-through. `mousedown` still `preventDefault`s to keep focus off the option
|
|
542
|
+
(the reason it lived on mousedown), but selection waits for the completed gesture. -->
|
|
538
543
|
<button
|
|
539
544
|
bind:this={itemElements[index]}
|
|
540
545
|
type="button"
|
|
@@ -552,7 +557,8 @@
|
|
|
552
557
|
style="border: none; border-radius: 0; justify-content: flex-start; {itemSnippet
|
|
553
558
|
? ''
|
|
554
559
|
: `height: ${itemHeight}px;`}"
|
|
555
|
-
onmousedown={(event) =>
|
|
560
|
+
onmousedown={(event) => event.preventDefault()}
|
|
561
|
+
onclick={(event) => selectOption(option.value, event)}
|
|
556
562
|
tabindex="-1"
|
|
557
563
|
role="option"
|
|
558
564
|
aria-selected={isSelected(option.value)}
|
|
@@ -211,10 +211,8 @@
|
|
|
211
211
|
? '[background-color:color-mix(in_srgb,var(--ui-color-text)_10%,transparent)]'
|
|
212
212
|
: ''}"
|
|
213
213
|
onmouseenter={() => (active = i)}
|
|
214
|
-
onmousedown={(e) =>
|
|
215
|
-
|
|
216
|
-
accept(s);
|
|
217
|
-
}}
|
|
214
|
+
onmousedown={(e) => e.preventDefault()}
|
|
215
|
+
onclick={() => accept(s)}
|
|
218
216
|
>
|
|
219
217
|
<span class="font-mono">{ctx.type === "column" ? "$" : ""}{s.value}</span>
|
|
220
218
|
{#if s.label !== s.value}<span
|