@juspay/svelte-ui-components 2.69.0 → 2.69.1
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.
|
@@ -272,6 +272,17 @@
|
|
|
272
272
|
onopentoggle?.({ open: false });
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
+
// The trigger toggles: clicking it while the panel is already open dismisses
|
|
276
|
+
// the picker instead of re-opening it onto itself. The open-only handler left
|
|
277
|
+
// a second click feeling dead — the panel could only be closed by clicking away.
|
|
278
|
+
function togglePicker(): void {
|
|
279
|
+
if (isOpen) {
|
|
280
|
+
closePicker();
|
|
281
|
+
} else {
|
|
282
|
+
openPicker();
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
275
286
|
function openComparePicker(): void {
|
|
276
287
|
compareFocusReturnEl =
|
|
277
288
|
document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
@@ -504,7 +515,7 @@
|
|
|
504
515
|
<!-- Trigger wrapper — bind:this here so outside-click detection works -->
|
|
505
516
|
<div bind:this={triggerRef} class="drp-trigger-wrapper">
|
|
506
517
|
<Button
|
|
507
|
-
onclick={
|
|
518
|
+
onclick={togglePicker}
|
|
508
519
|
ariaLabel="Open date picker"
|
|
509
520
|
classes="drp-trigger {isOpen ? 'drp-trigger-open' : ''}"
|
|
510
521
|
>
|