fix(structure): virtualize column grid for smooth large-table scrolling
This commit is contained in:
6 files changed
+962
-519
No files matched your search
+171
-20
@@ -227,6 +227,8 @@ vi.mock("@/stores/settingsStore", () => ({
|
||||
}));
|
||||
vi.mock("@/composables/useTheme", () => ({ useTheme: () => ({ isDark: { value: false }, themePalette: { value: "default" } }) }));
|
||||
vi.mock("@/composables/useToast", () => ({ useToast: () => ({ toast: mocks.toast }) }));
|
||||
vi.mock("@/lib/backend/platform", () => ({ isMacOS: () => true }));
|
||||
vi.mock("@/lib/backend/tauriRuntime", () => ({ isTauriRuntime: () => true }));
|
||||
vi.mock("@/lib/sql/sqlHighlighter", () => ({ createShikiSqlHighlighter: vi.fn(async () => (sql: string) => sql) }));
|
||||
vi.mock("@/lib/metadata/objectDdlCache", () => ({
|
||||
loadObjectDdl: mocks.loadObjectDdl,
|
||||
@@ -309,10 +311,36 @@ function draft(isPrimaryKey = false, identity?: { seed: number; increment: numbe
|
||||
};
|
||||
}
|
||||
|
||||
function draftWithColumns(count: number) {
|
||||
const value = draft();
|
||||
value.columns = Array.from({ length: count }, (_, index) => ({
|
||||
id: `existing:field_${index}`,
|
||||
name: `field_${index}`,
|
||||
dataType: "varchar(255)",
|
||||
isNullable: true,
|
||||
defaultValue: "",
|
||||
comment: "",
|
||||
isPrimaryKey: false,
|
||||
extra: {},
|
||||
original: {
|
||||
name: `field_${index}`,
|
||||
data_type: "varchar(255)",
|
||||
is_nullable: true,
|
||||
column_default: null,
|
||||
is_primary_key: false,
|
||||
extra: null,
|
||||
comment: null,
|
||||
},
|
||||
originalPosition: index,
|
||||
markedForDrop: false,
|
||||
}));
|
||||
return value;
|
||||
}
|
||||
|
||||
async function mountEditor(
|
||||
databaseType: "sqlserver" | "postgres" | "sqlite" | "oracle" | "oceanbase-oracle" | "iris" | "dameng" | "duckdb" | "informix",
|
||||
databaseType: "mysql" | "sqlserver" | "postgres" | "sqlite" | "oracle" | "oceanbase-oracle" | "iris" | "dameng" | "duckdb" | "informix" | "clickhouse",
|
||||
isPrimaryKey = false,
|
||||
options: { database?: string; dynamicTypes?: string[]; identity?: { seed: number; increment: number }; tableName?: string; columnName?: string; foreignKeyRefTable?: string } = {},
|
||||
options: { database?: string; dynamicTypes?: string[]; identity?: { seed: number; increment: number }; tableName?: string; columnName?: string; foreignKeyRefTable?: string; draftOverride?: ReturnType<typeof draft>; onDraftUpdate?: (value: unknown) => void } = {},
|
||||
) {
|
||||
mocks.connection.db_type = databaseType;
|
||||
mocks.connection.name = databaseType;
|
||||
@@ -328,7 +356,8 @@ async function mountEditor(
|
||||
database: options.database ?? "test",
|
||||
schema: "SYSDBA",
|
||||
tableName: options.tableName ?? "users",
|
||||
draft: draft(isPrimaryKey, options.identity, options.columnName, options.foreignKeyRefTable),
|
||||
draft: options.draftOverride ?? draft(isPrimaryKey, options.identity, options.columnName, options.foreignKeyRefTable),
|
||||
"onUpdate:draft": options.onDraftUpdate,
|
||||
});
|
||||
mountedApps.push(app);
|
||||
app.mount(root);
|
||||
@@ -748,26 +777,26 @@ describe("TableStructureEditor data type options", () => {
|
||||
});
|
||||
|
||||
describe("TableStructureEditor action column", () => {
|
||||
it("moves delayed shortcut hints onto the add, copy, and delete controls", async () => {
|
||||
it("keeps the add shortcut tooltip and exposes row shortcuts without per-row tooltip components", async () => {
|
||||
const root = await mountEditor("dameng");
|
||||
|
||||
expect(root.textContent).not.toContain("settings.shortcutsTab");
|
||||
expect(root.querySelector("[data-field-shortcut-hints]")).toBeNull();
|
||||
|
||||
const addTooltip = root.querySelector<HTMLElement>("[data-add-column-shortcut-tooltip]");
|
||||
const copyTooltip = root.querySelector<HTMLElement>("[data-copy-column-shortcut-tooltip]");
|
||||
const deleteTooltip = root.querySelector<HTMLElement>("[data-delete-column-shortcut-tooltip]");
|
||||
const copyButton = root.querySelector<HTMLElement>("[data-copy-column-shortcut-button]");
|
||||
const deleteButton = root.querySelector<HTMLElement>("[data-delete-column-shortcut-button]");
|
||||
expect(addTooltip?.getAttribute("delay-duration")).toBe("500");
|
||||
expect(copyTooltip?.getAttribute("delay-duration")).toBe("500");
|
||||
expect(deleteTooltip?.getAttribute("delay-duration")).toBe("500");
|
||||
expect(root.querySelector("[data-add-column-shortcut-content]")?.textContent).toBe("Shift+Enter");
|
||||
// The add control already renders its label, so that hint stays a bare shortcut.
|
||||
expect(root.querySelector("[data-add-column-shortcut-content]")?.textContent).not.toContain("structureEditor.addColumn");
|
||||
// The icon-only copy/delete controls must name the action next to the shortcut (#9870).
|
||||
expect(root.querySelector("[data-copy-column-shortcut-content]")?.textContent).toBe("structureEditor.copyColumn⌘/Ctrl+D");
|
||||
expect(root.querySelector("[data-delete-column-shortcut-content]")?.textContent).toBe("structureEditor.drop⌘/Ctrl+Del");
|
||||
expect(copyTooltip?.querySelector("button")?.hasAttribute("title")).toBe(false);
|
||||
expect(deleteTooltip?.querySelector("button")?.hasAttribute("title")).toBe(false);
|
||||
// The icon-only copy/delete controls name the action next to the shortcut in native titles (#9870).
|
||||
expect(root.querySelector("[data-copy-column-shortcut-tooltip]")).toBeNull();
|
||||
expect(root.querySelector("[data-delete-column-shortcut-tooltip]")).toBeNull();
|
||||
expect(copyButton?.getAttribute("title")).toBe("structureEditor.copyColumn ⌘/Ctrl+D");
|
||||
expect(copyButton?.getAttribute("aria-keyshortcuts")).toBe("Control+D Meta+D");
|
||||
expect(deleteButton?.getAttribute("title")).toBe("structureEditor.drop ⌘/Ctrl+Del");
|
||||
expect(deleteButton?.getAttribute("aria-keyshortcuts")).toBe("Control+Delete Meta+Delete");
|
||||
});
|
||||
|
||||
it("names the delete control after the action it currently performs", async () => {
|
||||
@@ -776,13 +805,13 @@ describe("TableStructureEditor action column", () => {
|
||||
const persistedDelete = root.querySelector<HTMLButtonElement>('button[aria-label="structureEditor.drop"]');
|
||||
if (!persistedDelete) throw new Error("Missing delete button for the persisted column");
|
||||
persistedDelete.click();
|
||||
await vi.waitFor(() => expect(root.querySelector("[data-delete-column-shortcut-content]")?.textContent).toBe("structureEditor.restore⌘/Ctrl+Del"));
|
||||
await vi.waitFor(() => expect(root.querySelector<HTMLButtonElement>("[data-delete-column-shortcut-button]")?.getAttribute("title")).toBe("structureEditor.restore"));
|
||||
|
||||
buttonWithText(root, "structureEditor.addColumn").click();
|
||||
await vi.waitFor(() => expect(root.querySelector('[data-column-row-index="1"]')).not.toBeNull());
|
||||
const addedRow = root.querySelector('[data-column-row-index="1"]');
|
||||
expect(addedRow?.querySelector('button[aria-label="structureEditor.remove"]')).not.toBeNull();
|
||||
expect(addedRow?.querySelector("[data-delete-column-shortcut-content]")?.textContent).toBe("structureEditor.remove⌘/Ctrl+Del");
|
||||
expect(addedRow?.querySelector("[data-delete-column-shortcut-button]")?.getAttribute("title")).toBe("structureEditor.remove ⌘/Ctrl+Del");
|
||||
});
|
||||
|
||||
it("adds a field below the focused input on Shift+Enter", async () => {
|
||||
@@ -906,6 +935,7 @@ describe("TableStructureEditor horizontal scrolling", () => {
|
||||
const root = await mountEditor("postgres");
|
||||
const scroller = root.querySelector<HTMLElement>(".structure-table-scroller");
|
||||
if (!scroller) throw new Error("Missing structure table scroller");
|
||||
expect(scroller.classList.contains("flow-mode")).toBe(true);
|
||||
Object.defineProperties(scroller, {
|
||||
clientWidth: { configurable: true, value: 400 },
|
||||
scrollWidth: { configurable: true, value: 1200 },
|
||||
@@ -935,6 +965,128 @@ describe("TableStructureEditor horizontal scrolling", () => {
|
||||
});
|
||||
|
||||
describe("TableStructureEditor vertical scrolling", () => {
|
||||
it.each(["mysql", "postgres", "sqlserver", "oracle", "sqlite", "dameng", "clickhouse"] as const)("virtualizes large %s field lists and moves the rendered window while scrolling", async (databaseType) => {
|
||||
const root = await mountEditor(databaseType, false, { draftOverride: draftWithColumns(200) });
|
||||
const scroller = root.querySelector<HTMLElement>(".structure-table-scroller");
|
||||
if (!scroller) throw new Error("Missing structure table scroller");
|
||||
Object.defineProperties(scroller, {
|
||||
clientHeight: { configurable: true, value: 330 },
|
||||
scrollHeight: { configurable: true, value: 6630 },
|
||||
scrollTop: { configurable: true, value: 0, writable: true },
|
||||
});
|
||||
|
||||
scroller.dispatchEvent(new Event("scroll"));
|
||||
await nextTick();
|
||||
|
||||
expect(root.querySelectorAll("[data-column-row-index]").length).toBeLessThan(40);
|
||||
expect(root.querySelector('[data-column-row-index="0"]')).not.toBeNull();
|
||||
expect(root.querySelector('[data-column-row-index="100"]')).toBeNull();
|
||||
|
||||
scroller.scrollTop = 3300;
|
||||
scroller.dispatchEvent(new Event("scroll"));
|
||||
await vi.waitFor(() => expect(root.querySelector('[data-column-row-index="100"][data-column-row-active="true"]')).not.toBeNull());
|
||||
|
||||
expect(root.querySelectorAll('[data-column-row-active="true"]')).not.toHaveLength(0);
|
||||
});
|
||||
|
||||
it("keeps the shared context menu targeted to a recycled field row", async () => {
|
||||
const root = await mountEditor("mysql", false, { draftOverride: draftWithColumns(200) });
|
||||
const scroller = root.querySelector<HTMLElement>(".structure-table-scroller");
|
||||
if (!scroller) throw new Error("Missing structure table scroller");
|
||||
Object.defineProperties(scroller, {
|
||||
clientHeight: { configurable: true, value: 330 },
|
||||
scrollHeight: { configurable: true, value: 6630 },
|
||||
scrollTop: { configurable: true, value: 3300, writable: true },
|
||||
});
|
||||
|
||||
scroller.dispatchEvent(new Event("scroll"));
|
||||
await vi.waitFor(() => expect(root.querySelector('[data-column-row-index="100"][data-column-row-active="true"]')).not.toBeNull());
|
||||
|
||||
const targetRow = root.querySelector<HTMLElement>('[data-column-row-index="100"]');
|
||||
targetRow?.dispatchEvent(new MouseEvent("contextmenu", { bubbles: true, button: 2, clientX: 20, clientY: 20 }));
|
||||
await nextTick();
|
||||
|
||||
const contextMenu = document.body.querySelector<HTMLElement>("[data-dbx-context-menu]");
|
||||
if (!contextMenu) throw new Error("Missing shared column context menu");
|
||||
buttonWithText(contextMenu, "structureEditor.copyColumn").click();
|
||||
await vi.waitFor(() => expect(root.querySelector('[data-column-row-index="101"][data-new-column-row="true"]')).not.toBeNull());
|
||||
});
|
||||
|
||||
it("uses scheduled updates for small scrolls and synchronously catches jumps beyond the virtual buffer", async () => {
|
||||
const root = await mountEditor("mysql", false, { draftOverride: draftWithColumns(200) });
|
||||
const scroller = root.querySelector<HTMLElement>(".structure-table-scroller");
|
||||
if (!scroller) throw new Error("Missing structure table scroller");
|
||||
Object.defineProperties(scroller, {
|
||||
clientHeight: { configurable: true, value: 330 },
|
||||
scrollHeight: { configurable: true, value: 6630 },
|
||||
scrollTop: { configurable: true, value: 0, writable: true },
|
||||
});
|
||||
|
||||
const requestAnimationFrameSpy = vi.spyOn(window, "requestAnimationFrame").mockImplementation(() => 1);
|
||||
try {
|
||||
expect(root.querySelector('[data-column-row-index="30"]')).toBeNull();
|
||||
|
||||
scroller.scrollTop = 66;
|
||||
scroller.dispatchEvent(new Event("scroll"));
|
||||
await nextTick();
|
||||
expect(root.querySelector('[data-column-row-index="30"]')).toBeNull();
|
||||
|
||||
scroller.scrollTop = 660;
|
||||
scroller.dispatchEvent(new Event("scroll"));
|
||||
await nextTick();
|
||||
|
||||
expect(root.querySelector('[data-column-row-index="30"][data-column-row-active="true"]')).not.toBeNull();
|
||||
expect(root.querySelectorAll('[data-column-row-active="true"]')).not.toHaveLength(0);
|
||||
} finally {
|
||||
requestAnimationFrameSpy.mockRestore();
|
||||
}
|
||||
});
|
||||
|
||||
it("virtualizes PostgreSQL geometry rows with precomputed item sizes", async () => {
|
||||
const value = draftWithColumns(80);
|
||||
value.columns[0].dataType = "geometry(GEOMETRY,4326)";
|
||||
value.columns[0].original!.data_type = "geometry(GEOMETRY,4326)";
|
||||
|
||||
const root = await mountEditor("postgres", false, { draftOverride: value });
|
||||
|
||||
expect(root.querySelectorAll("[data-column-row-index]").length).toBeLessThan(80);
|
||||
expect(root.querySelector('[data-column-row-index="0"]')).not.toBeNull();
|
||||
});
|
||||
|
||||
it("persists rapid scroll events once after scrolling settles", async () => {
|
||||
const onDraftUpdate = vi.fn();
|
||||
const root = await mountEditor("mysql", false, { draftOverride: draftWithColumns(200), onDraftUpdate });
|
||||
const scroller = root.querySelector<HTMLElement>(".structure-table-scroller");
|
||||
if (!scroller) throw new Error("Missing structure table scroller");
|
||||
Object.defineProperties(scroller, {
|
||||
clientHeight: { configurable: true, value: 330 },
|
||||
scrollHeight: { configurable: true, value: 6630 },
|
||||
scrollTop: { configurable: true, value: 0, writable: true },
|
||||
});
|
||||
const baselineDraft = onDraftUpdate.mock.calls[onDraftUpdate.mock.calls.length - 1]?.[0] as ReturnType<typeof draft> | undefined;
|
||||
expect(baselineDraft).toBeDefined();
|
||||
onDraftUpdate.mockClear();
|
||||
vi.useFakeTimers();
|
||||
try {
|
||||
for (const scrollTop of [300, 600, 900]) {
|
||||
scroller.scrollTop = scrollTop;
|
||||
scroller.dispatchEvent(new Event("scroll"));
|
||||
}
|
||||
await nextTick();
|
||||
expect(onDraftUpdate).not.toHaveBeenCalled();
|
||||
|
||||
vi.advanceTimersByTime(180);
|
||||
await nextTick();
|
||||
|
||||
expect(onDraftUpdate).toHaveBeenCalledTimes(1);
|
||||
expect(onDraftUpdate.mock.calls[0]?.[0]).toMatchObject({ scrollPositions: { columns: { scrollTop: 900, scrollLeft: 0 } } });
|
||||
expect(onDraftUpdate.mock.calls[0]?.[0].columns).toBe(baselineDraft?.columns);
|
||||
expect(onDraftUpdate.mock.calls[0]?.[0].indexes).toBe(baselineDraft?.indexes);
|
||||
} finally {
|
||||
vi.useRealTimers();
|
||||
}
|
||||
});
|
||||
|
||||
it("shows a fixed scrollbar for overflowing fields and syncs thumb dragging", async () => {
|
||||
const root = await mountEditor("postgres");
|
||||
const scroller = root.querySelector<HTMLElement>(".structure-table-scroller");
|
||||
@@ -946,12 +1098,11 @@ describe("TableStructureEditor vertical scrolling", () => {
|
||||
});
|
||||
|
||||
scroller.dispatchEvent(new Event("scroll"));
|
||||
await nextTick();
|
||||
await nextTick();
|
||||
await vi.waitFor(() => expect(root.querySelector(".structure-vertical-scrollbar__thumb")).not.toBeNull());
|
||||
|
||||
const track = root.querySelector<HTMLElement>(".structure-vertical-scrollbar");
|
||||
const thumb = root.querySelector<HTMLElement>(".structure-vertical-scrollbar__thumb");
|
||||
if (!track || !thumb) throw new Error("Missing fixed vertical scrollbar");
|
||||
const track = root.querySelector<HTMLElement>(".structure-vertical-scrollbar")!;
|
||||
const thumb = root.querySelector<HTMLElement>(".structure-vertical-scrollbar__thumb")!;
|
||||
await vi.waitFor(() => expect(Number.parseFloat(thumb.style.height)).toBeCloseTo(25));
|
||||
expect(Number.parseFloat(thumb.style.height)).toBeCloseTo(25);
|
||||
expect(Number.parseFloat(thumb.style.top)).toBeCloseTo(0);
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -93,6 +93,9 @@ const triggerBaseClass = computed(() =>
|
||||
const filteredOptions = computed(() => filterDatabaseOptions(props.options, searchText.value, props.displayName));
|
||||
const customOptionValue = computed(() => props.normalizeCustom(props.trimCustom ? searchText.value.trim() : searchText.value));
|
||||
const canSelectCustom = computed(() => props.allowCustom && !!customOptionValue.value && !props.options.includes(customOptionValue.value));
|
||||
const closedFilteredOptions: string[] = [];
|
||||
const openFilteredOptions = computed(() => (open.value ? filteredOptions.value : closedFilteredOptions));
|
||||
const openOptionsSignature = computed(() => (open.value ? props.options.join("\0") : ""));
|
||||
|
||||
function highlightSelectedOption() {
|
||||
const selectedIndex = filteredOptions.value.findIndex((option) => option === props.modelValue);
|
||||
@@ -134,22 +137,20 @@ watch(open, async (value) => {
|
||||
});
|
||||
|
||||
watch(searchText, () => {
|
||||
if (!open.value) return;
|
||||
highlightIndex.value = 0;
|
||||
activeHelpOption.value = searchableSelectKeyboardTooltipOption(filteredOptions.value, 0, props.optionTooltip);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => [props.modelValue, props.options],
|
||||
() => {
|
||||
if (!open.value || searchText.value) return;
|
||||
activeHelpOption.value = undefined;
|
||||
highlightAndScrollSelectedOption();
|
||||
activateInitialHelpOption();
|
||||
},
|
||||
{ deep: true },
|
||||
);
|
||||
watch([() => (open.value ? props.modelValue : undefined), openOptionsSignature], ([_modelValue], [previousModelValue]) => {
|
||||
if (!open.value || previousModelValue === undefined || searchText.value) return;
|
||||
activeHelpOption.value = undefined;
|
||||
highlightAndScrollSelectedOption();
|
||||
activateInitialHelpOption();
|
||||
});
|
||||
|
||||
watch([highlightIndex, filteredOptions], () => {
|
||||
watch([highlightIndex, openFilteredOptions], () => {
|
||||
if (!open.value) return;
|
||||
void scrollHighlightedOptionIntoView();
|
||||
emit("option-highlight", filteredOptions.value[highlightIndex.value]);
|
||||
});
|
||||
@@ -186,7 +187,8 @@ async function updateHelpPanelOffset() {
|
||||
});
|
||||
}
|
||||
|
||||
watch([activeHelpOption, filteredOptions], () => {
|
||||
watch([activeHelpOption, openFilteredOptions], () => {
|
||||
if (!open.value) return;
|
||||
void updateHelpPanelOffset();
|
||||
});
|
||||
|
||||
|
||||
Vendored
+17
@@ -34,6 +34,23 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe("SearchableSelect trigger", () => {
|
||||
it("does not traverse option values while the popover is closed", () => {
|
||||
let optionReads = 0;
|
||||
const options = ["Point", "LineString"];
|
||||
Object.defineProperty(options, "1", {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get() {
|
||||
optionReads += 1;
|
||||
return "LineString";
|
||||
},
|
||||
});
|
||||
|
||||
mountSelect({ options });
|
||||
|
||||
expect(optionReads).toBe(0);
|
||||
});
|
||||
|
||||
it("renders the trigger button itself as the layout participant", () => {
|
||||
const { root } = mountSelect({ triggerClass: "min-w-0 flex-1" });
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import { computed, onBeforeUnmount, ref, watch, type CSSProperties, type Ref } f
|
||||
* when its content grows (e.g. async-loaded rows/charts) — only `contentRef`,
|
||||
* an in-flow element, reports that growth via ResizeObserver.
|
||||
*/
|
||||
export function useVerticalOverlayScrollbar(scrollerRef: Ref<HTMLElement | null>, contentRef: Ref<HTMLElement | null>, trackRef: Ref<HTMLElement | null>) {
|
||||
export function useVerticalOverlayScrollbar(scrollerRef: Ref<HTMLElement | null>, contentRef: Ref<HTMLElement | null>, trackRef: Ref<HTMLElement | null>, thumbRef?: Ref<HTMLElement | null>) {
|
||||
const hasOverflow = ref(false);
|
||||
const isScrolling = ref(false);
|
||||
const isDragging = ref(false);
|
||||
@@ -25,8 +25,16 @@ export function useVerticalOverlayScrollbar(scrollerRef: Ref<HTMLElement | null>
|
||||
let scrollerResizeObserver: ResizeObserver | null = null;
|
||||
let contentResizeObserver: ResizeObserver | null = null;
|
||||
let scrollHideTimer: ReturnType<typeof setTimeout> | null = null;
|
||||
let scrollMetricsAnimationFrame: number | null = null;
|
||||
let dragOffsetPx = 0;
|
||||
|
||||
function applyThumbStyle() {
|
||||
const thumb = thumbRef?.value;
|
||||
if (!thumb) return;
|
||||
thumb.style.top = `${thumbTopPercent.value}%`;
|
||||
thumb.style.height = `${thumbHeightPercent.value}%`;
|
||||
}
|
||||
|
||||
function updateMetrics() {
|
||||
const el = scrollerRef.value;
|
||||
if (!el) {
|
||||
@@ -40,10 +48,23 @@ export function useVerticalOverlayScrollbar(scrollerRef: Ref<HTMLElement | null>
|
||||
const thumbTravel = Math.max(0, 100 - thumbHeight);
|
||||
thumbHeightPercent.value = thumbHeight;
|
||||
thumbTopPercent.value = maxScrollTop > 0 ? (el.scrollTop / maxScrollTop) * thumbTravel : 0;
|
||||
applyThumbStyle();
|
||||
}
|
||||
|
||||
function scheduleMetricsUpdate() {
|
||||
if (typeof window === "undefined" || typeof window.requestAnimationFrame !== "function") {
|
||||
updateMetrics();
|
||||
return;
|
||||
}
|
||||
if (scrollMetricsAnimationFrame !== null) return;
|
||||
scrollMetricsAnimationFrame = window.requestAnimationFrame(() => {
|
||||
scrollMetricsAnimationFrame = null;
|
||||
updateMetrics();
|
||||
});
|
||||
}
|
||||
|
||||
function onScroll() {
|
||||
updateMetrics();
|
||||
scheduleMetricsUpdate();
|
||||
isScrolling.value = true;
|
||||
if (scrollHideTimer) clearTimeout(scrollHideTimer);
|
||||
scrollHideTimer = setTimeout(() => {
|
||||
@@ -135,11 +156,16 @@ export function useVerticalOverlayScrollbar(scrollerRef: Ref<HTMLElement | null>
|
||||
{ flush: "post", immediate: true },
|
||||
);
|
||||
|
||||
if (thumbRef) {
|
||||
watch(thumbRef, applyThumbStyle, { flush: "post" });
|
||||
}
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
scrollerResizeObserver?.disconnect();
|
||||
contentResizeObserver?.disconnect();
|
||||
stopDrag();
|
||||
if (scrollHideTimer) clearTimeout(scrollHideTimer);
|
||||
if (scrollMetricsAnimationFrame !== null) window.cancelAnimationFrame(scrollMetricsAnimationFrame);
|
||||
});
|
||||
|
||||
const thumbStyle = computed<CSSProperties>(() => ({
|
||||
|
||||
Reference in new issue
Block a user