@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]
|
|
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}
|