@abhivarde/svelte-drawer 0.0.8 → 0.0.9

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.
@@ -131,7 +131,11 @@
131
131
  if (drawer.open && trapFocus && contentElement) {
132
132
  tick().then(() => {
133
133
  const focusable = getFocusableElements();
134
- (focusable[0] ?? contentElement)?.focus();
134
+ if (focusable[0]) {
135
+ focusable[0].focus({ preventScroll: true });
136
+ } else {
137
+ contentElement?.focus({ preventScroll: true });
138
+ }
135
139
  });
136
140
  }
137
141
  });
@@ -157,4 +161,4 @@
157
161
  >
158
162
  {@render children()}
159
163
  </div>
160
- {/if}
164
+ {/if}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abhivarde/svelte-drawer",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "A drawer component for Svelte 5, inspired by Vaul",
5
5
  "author": "Abhi Varde",
6
6
  "license": "MIT",