Lint and prevent scrolling to selected component when starting dragging

This commit is contained in:
Andrew Kingston 2022-10-14 19:45:47 +01:00
parent adc7e8e5fc
commit d166cbb466
3 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,6 @@
import { get, writable } from "svelte/store" import { get, writable } from "svelte/store"
import { cloneDeep } from "lodash/fp" import { cloneDeep } from "lodash/fp"
import { selectedScreen, selectedComponent, store } from "builderStore" import { selectedScreen, selectedComponent } from "builderStore"
import { import {
datasources, datasources,
integrations, integrations,

View File

@ -421,7 +421,11 @@
} }
const scrollIntoView = () => { const scrollIntoView = () => {
// Don't scroll into view if we selected this component because we were
// starting dragging on it
if (get(dndIsDragging)) {
return return
}
const node = document.getElementsByClassName(id)?.[0]?.children[0] const node = document.getElementsByClassName(id)?.[0]?.children[0]
if (!node) { if (!node) {
return return

View File

@ -4,8 +4,6 @@
* @param fn the async function to run * @param fn the async function to run
* @return {Promise} a sequential version of the function * @return {Promise} a sequential version of the function
*/ */
import { lastIndexOf } from "lodash/array"
export const sequential = fn => { export const sequential = fn => {
let queue = [] let queue = []
return async (...params) => { return async (...params) => {