@dosgato/dialog 1.0.5 → 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.
@@ -137,6 +137,7 @@ $: describedby = [title ? labelid : undefined, descid].filter(isNotBlank).join('
137
137
  overflow: auto;
138
138
  background-color: var(--dg-dialog-content-bg, #f4f4f4);
139
139
  max-height: calc(100vh - 7.5em);
140
+ max-height: calc(100dvh - 7.5em);
140
141
  }
141
142
 
142
143
  section.tiny .dialog-content, section.small .dialog-content {
@@ -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
- treeStore.trigger();
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dosgato/dialog",
3
3
  "description": "A component library for building forms that edit a JSON document.",
4
- "version": "1.0.5",
4
+ "version": "1.0.7",
5
5
  "scripts": {
6
6
  "prepublishOnly": "svelte-package",
7
7
  "dev": "vite dev --force",