@dosgato/dialog 1.0.6 → 1.0.7
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import browserIcon from '@iconify-icons/ph/browser';
|
|
2
2
|
import folderIcon from '@iconify-icons/ph/folder';
|
|
3
3
|
import folderNotchOpen from '@iconify-icons/ph/folder-notch-open';
|
|
4
|
-
import { createEventDispatcher, getContext, onMount, setContext } from 'svelte';
|
|
4
|
+
import { createEventDispatcher, getContext, onMount, setContext, tick } from 'svelte';
|
|
5
5
|
import { isNotBlank, randomid } from 'txstate-utils';
|
|
6
6
|
import { Button, Dialog, iconForMime, Tabs, Tree, UploadUI } from '..';
|
|
7
7
|
import { CHOOSER_API_CONTEXT } from './ChooserAPI';
|
|
@@ -68,8 +68,11 @@ async function selectPreview(preloadPath) {
|
|
|
68
68
|
if (!currentSelection)
|
|
69
69
|
return;
|
|
70
70
|
store.setPreview(currentSelection);
|
|
71
|
-
treeStore.select(currentSelection, {});
|
|
72
|
-
|
|
71
|
+
treeStore.select(currentSelection, { clear: true });
|
|
72
|
+
await tick();
|
|
73
|
+
const focusedElement = document.querySelector('.tree-node[tabindex="0"]');
|
|
74
|
+
if (focusedElement?.classList.contains('tree-node'))
|
|
75
|
+
focusedElement.scrollIntoView({ block: 'center' });
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
onMount(async () => {
|
package/package.json
CHANGED