v1.2.0
1.2.0 - Major release
⚠️ Breaking changes
svaul-* namespace
Every hook the library exposes to the DOM/CSS is now brand-namespaced (was the too-generic data-drawer / --drawer-*, which could collide with your own selectors/vars).
Migration
| Before | After |
|---|---|
[data-drawer], [data-drawer-overlay], [data-drawer-handle], … |
[data-svaul-drawer], [data-svaul-drawer-overlay], … |
[data-drawer-wrapper], [data-drawer-no-drag] |
[data-svaul-drawer-wrapper], [data-svaul-drawer-no-drag] |
--drawer-bg, --drawer-radius, --drawer-handle-bg, … |
--svaul-drawer-bg, --svaul-drawer-radius, … |
.drawer-dragging |
.svaul-drawer-dragging |
data-svaul-ignore and data-state are unchanged. If you don't target svaul's attributes/vars in your own CSS, no changes are needed.
⚠️ Peer dependency
svelte peer range tightened ^5.0.0 → ^5.29.0 — the code requires createAttachmentKey/{@attach} (5.29) and $props.id() (5.20). Previously 5.0–5.28 installed cleanly then failed to compile.
Fixes
Gestures
- Swipe-to-close now survives
pointercancel/touchcancelfrom scrollable content and system interruptions (incoming call, shade pull). - Direction-aware scroll-vs-drag gate: top drawers use the bottom scroll edge; side drawers yield to horizontal scrollers (and can be swiped closed at the edge).
overscroll-behaviorstops Android pull-to-refresh during a swipe-close.- Multi-touch no longer corrupts a drag; abandoned cross-axis gestures no longer jump snap points; drag state can't get stuck.
Snap points
- Snap points supplied/changed after mount reconcile correctly (no more off-screen/frozen drawer); container-relative offsets reflow on resize/rotation; unit-less string points (
"0.5") resolve as fractions.
A11y
- Only the topmost drawer traps Tab (nested drawers no longer freeze keyboard nav); Escape ignored during IME composition; SSR markup carries the accessible name; focus restore no longer drops to
<body>;visibility:hiddenelements excluded from the focus trap.
Mobile / visual
- Reopening a
keepMounted(or quickly-reopened) drawer no longer sticks mid-drag; scroll-lock restores both axes instantly; background-scale revert can't leave a permanently-black body; drawer text is selectable (not blanketuser-select:none).
Cleanup
- Removed a dead CSS selector and a write-only attribute.