We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c23e62 commit bd6b5ddCopy full SHA for bd6b5dd
src/routes/tutorial/[slug]/Menu.svelte
@@ -18,13 +18,19 @@
18
19
let expanded_part = '';
20
let expanded_chapter = '';
21
+ let duration = 0;
22
- $: if (is_open) {
23
+ // The following statements ensure that the select animation is not run during opening the menu
24
+ $: if (is_open || !is_open) {
25
expanded_part = current.part.slug;
26
expanded_chapter = current.chapter.slug;
27
}
-
- const duration = browser && matchMedia('(prefers-reduced-motion: reduce)').matches ? 0 : 200;
28
+ $: if (is_open) {
29
+ duration = 0;
30
+ setTimeout(() => {
31
+ duration = browser && matchMedia('(prefers-reduced-motion: reduce)').matches ? 0 : 200;
32
+ }, 210);
33
+ }
34
35
$: regex = new RegExp(`\\b${search.length >= 2 ? search : ''}`, 'i');
36
0 commit comments