@dosgato/dialog 0.0.48 → 0.0.49

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.
@@ -95,15 +95,11 @@ function headerDragReset() {
95
95
  let mounted = false;
96
96
  onMount(async () => {
97
97
  document.addEventListener('dragend', onDragEnd);
98
- const saveFocusId = $store.focused?.id;
99
98
  headerSizes.set(calcHeaderSizes()); // seems to need a kick on first mount
100
99
  await new Promise(resolve => requestAnimationFrame(resolve));
101
100
  // need to wait long enough for headers to redraw before trying to mount the rows
102
101
  await new Promise(resolve => requestAnimationFrame(resolve));
103
102
  mounted = true;
104
- const el = saveFocusId ? document.getElementById(getHashId(saveFocusId)) : undefined;
105
- if ($store.focused?.id && $store.focused.id === saveFocusId)
106
- el?.scrollIntoView({ block: 'center' });
107
103
  await store.refresh();
108
104
  });
109
105
  onDestroy(() => {
@@ -3,7 +3,7 @@ import checkboxBlankOutline from '@iconify-icons/mdi/checkbox-blank-outline';
3
3
  import menuDown from '@iconify-icons/mdi/menu-down';
4
4
  import menuRight from '@iconify-icons/mdi/menu-right';
5
5
  import { modifierKey, ScreenReaderOnly } from '@txstate-mws/svelte-components';
6
- import { createEventDispatcher, getContext } from 'svelte';
6
+ import { createEventDispatcher, getContext, onMount } from 'svelte';
7
7
  import { isNotBlank, toArray } from 'txstate-utils';
8
8
  import { Icon } from '..';
9
9
  import { TREE_STORE_CONTEXT, getHashId } from './treestore';
@@ -243,6 +243,10 @@ function onDragLeaveAbove(e) {
243
243
  else
244
244
  dragOverAbove--;
245
245
  }
246
+ onMount(() => {
247
+ if ($focused && $focused.id === item.id)
248
+ nodeelement.scrollIntoView({ block: 'center' });
249
+ });
246
250
  $: if ($dragging) {
247
251
  dragOver = 0;
248
252
  dragOverAbove = 0;
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": "0.0.48",
4
+ "version": "0.0.49",
5
5
  "scripts": {
6
6
  "prepublishOnly": "svelte-package",
7
7
  "dev": "vite dev --force",