Svelte: Fix calling DOM API functions on the actual elements

This commit is contained in:
Keavon Chambers
2023-01-13 17:17:38 -08:00
parent 0019340096
commit fb10e5194e
15 changed files with 162 additions and 96 deletions
@@ -109,7 +109,7 @@
await tick();
const textInput: HTMLInputElement | undefined = list?.querySelector("[data-text-input]:not([disabled])") || undefined;
const textInput = (list?.div().querySelector("[data-text-input]:not([disabled])") || undefined) as HTMLInputElement | undefined;
textInput?.select();
}
@@ -169,7 +169,7 @@
function calculateDragIndex(tree: LayoutCol, clientY: number, select?: () => void): DraggingData {
const treeChildren = tree.div().children;
const treeOffset = tree.getBoundingClientRect().top;
const treeOffset = tree.div().getBoundingClientRect().top;
// Closest distance to the middle of the row along the Y axis
let closest = Infinity;